diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/directivesSpec.js | 13 | ||||
| -rw-r--r-- | test/scenario/mocks.js | 4 |
2 files changed, 17 insertions, 0 deletions
diff --git a/test/directivesSpec.js b/test/directivesSpec.js index 93682fa0..51cc5489 100644 --- a/test/directivesSpec.js +++ b/test/directivesSpec.js @@ -535,4 +535,17 @@ describe("directive", function() { expect(element.hasClass('bar')).toBe(true); })); }); + + describe('ng:module', function() { + it('should install the modules', inject(function($injector, $compile, $rootScope) { + var log = ''; + var injector = $injector; + angular.module.a = function($injector){ log += ($injector == injector) + ';';}; + angular.module.b = function($injector){ log += ($injector == injector); } + $compile('<div ng:module=" a, ,,, b "></div>')($rootScope); + expect(log).toEqual('true;true'); + delete angular.module.a; + delete angular.module.b; + })); + }); }); diff --git a/test/scenario/mocks.js b/test/scenario/mocks.js index 5b7f7fcc..2db8577a 100644 --- a/test/scenario/mocks.js +++ b/test/scenario/mocks.js @@ -11,6 +11,10 @@ angular.scenario.testing.MockAngular.prototype.reset = function() { this.log = []; }; +angular.scenario.testing.MockAngular.prototype.element = function(e) { + return jqLite(e); +}; + angular.scenario.testing.MockAngular.prototype.$browser = function() { this.log.push('$brower()'); return this; |
