diff --git a/package.json b/package.json index eaa68e9..1cd861f 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,8 @@ "protractor": "~1.5.0", "http-server": "~0.7.4", "jasmine-core": "~2.1.3", - "angular": "~1.3.8", - "angular-mocks": "~1.3.8" + "angular": "~1.2.28", + "angular-mocks": "~1.2.28", + "angular-translate": "~2.5.2" } } diff --git a/test/karma-conf.js b/test/karma-conf.js index 430b2be..ea715cc 100644 --- a/test/karma-conf.js +++ b/test/karma-conf.js @@ -5,6 +5,7 @@ module.exports = function(config) { files: [ 'node_modules/angular/angular.js', 'node_modules/angular-mocks/angular-mocks.js', + 'node_modules/angular-translate/dist/angular-translate.js', 'salaryController.js', 'test/spec.js' ], diff --git a/test/spec.js b/test/spec.js index 21e7d5b..3285691 100644 --- a/test/spec.js +++ b/test/spec.js @@ -1,25 +1,13 @@ 'use strict'; describe('calculator module', function() { - var scope = {}; var ctrl; - var translate; beforeEach(module('calculator')); - beforeEach(inject(function(_$translate_) { - translate = function() { - translate.spy.apply(this, arguments); - }; - translate.spy = function() {}; - spyOn(translate, 'spy').andCallFake(function() { - // dummy - }); - })); - - beforeEach(inject(function($rootScope, $controller) { - scope = $rootScope.$new(); + beforeEach(inject(function($controller, $rootScope) { + scope = $rootScope.$new(); ctrl = $controller('salaryController', {$scope: scope}); }));