Fixed failing tests in MainControllerSpec & UserSettingSpec

This commit is contained in:
aaron-edwards 2014-01-02 10:40:33 +11:00
parent 6e3e773774
commit bc187a6f50
2 changed files with 9 additions and 3 deletions

View File

@ -13,14 +13,15 @@ describe("MainController", function() {
this.translate = jasmine.createSpyObj("translate", ["uses"]);
this.rootScope = jasmine.createSpy();
this.localStorageService = jasmine.createSpyObj("localStorageService", ["get"]);
this.localStorageService = jasmine.createSpyObj("localStorageService", ["get", "add"]);
this.controller = new mifosX.controllers.MainController(this.scope,
this.location,
this.sessionManager,
this.translate,
this.rootScope,
this.localStorageService, this.keyboardManager);
this.localStorageService,
this.keyboardManager);
});
describe("on initialisation", function() {
@ -32,6 +33,11 @@ describe("MainController", function() {
sessionCallback("test_session");
expect(this.scope.currentSession).toEqual("test_session");
});
it("should set the dateformat in the scope" , function() {
expect(this.scope.dateformat).toEqual("dd MMMM yyyy");
expect(this.scope.df).toEqual("dd MMMM yyyy");
});
});
describe("on receving 'UserAuthenticationSuccessEvent'", function() {

View File

@ -1,7 +1,7 @@
describe("UserSettingController", function() {
beforeEach(function() {
this.scope = {};
this.scope = jasmine.createSpyObj("$scope", ['$watch']);
this.translate = {
uses: jasmine.createSpy("translate.uses()")
};