From 15893f0ffaa07ae423da534e944668db949380cb Mon Sep 17 00:00:00 2001 From: thoughtworker Date: Wed, 27 Nov 2013 11:12:31 -0600 Subject: [PATCH] passing tests --- test/SpecRunner.html | 2 ++ .../controllers/UserSettingControllerSpec.js | 23 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 test/spec/controllers/UserSettingControllerSpec.js diff --git a/test/SpecRunner.html b/test/SpecRunner.html index da3b416b..77d4dc26 100644 --- a/test/SpecRunner.html +++ b/test/SpecRunner.html @@ -32,6 +32,7 @@ + @@ -51,6 +52,7 @@ + diff --git a/test/spec/controllers/UserSettingControllerSpec.js b/test/spec/controllers/UserSettingControllerSpec.js new file mode 100644 index 00000000..cfbc6086 --- /dev/null +++ b/test/spec/controllers/UserSettingControllerSpec.js @@ -0,0 +1,23 @@ +describe("UserSettingController", function() { + var resourceCallback; + beforeEach(function() { + this.scope = {}; + + this.translate = jasmine.createSpyObj("translate", ["uses"]); + + this.controller = new mifosX.controllers.UserSettingController(this.scope, this.translate); + }); + + it("should populate the scope with available languages", function() { + expect(this.scope.langs).not.toBeNull(); + }); + + it("should set the default language", function() { + expect(this.scope.optlang).toEqual(this.scope.langs[0]); + }); + + it("should change the default language", function() { + this.scope.changeLang('blah') + expect(this.scope.optlang).toEqual('blah') + }); +});