diff options
| author | Pete Bacon Darwin | 2013-10-10 09:11:21 +0100 | 
|---|---|---|
| committer | Igor Minar | 2013-10-10 11:58:15 -0700 | 
| commit | 07272608d8ae39a5dd220cdb5637b1439342d5c3 (patch) | |
| tree | 7f0140b96fac88eee30cf94e01a9589cd25c8b37 /test/ngRoute/directive/ngViewSpec.js | |
| parent | b019a48bb1176f3c9ce29b628a321b6ffe873393 (diff) | |
| download | angular.js-07272608d8ae39a5dd220cdb5637b1439342d5c3.tar.bz2 | |
fix(modules): stop leaking global variables in tests
The routeUtils.js file was declaring a number of functions that were
leaking into other modules such as ngMocks causing tests to pass
incorrectly.
Closes #4360
Diffstat (limited to 'test/ngRoute/directive/ngViewSpec.js')
| -rw-r--r-- | test/ngRoute/directive/ngViewSpec.js | 22 | 
1 files changed, 11 insertions, 11 deletions
| diff --git a/test/ngRoute/directive/ngViewSpec.js b/test/ngRoute/directive/ngViewSpec.js index d38b3ba9..2d74760c 100644 --- a/test/ngRoute/directive/ngViewSpec.js +++ b/test/ngRoute/directive/ngViewSpec.js @@ -279,7 +279,7 @@ describe('ngView', function() {    it('should be async even if served from cache', function() {      module(function($routeProvider) { -      $routeProvider.when('/foo', {controller: noop, templateUrl: 'myUrl1'}); +      $routeProvider.when('/foo', {controller: angular.noop, templateUrl: 'myUrl1'});      });      inject(function($route, $rootScope, $location, $templateCache) { @@ -498,16 +498,16 @@ describe('ngView', function() {        $location.url('/foo');        $rootScope.$digest(); -      forEach(element.contents(), function(node) { +      angular.forEach(element.contents(), function(node) {          if(node.nodeType == 3 /* text node */) { -          expect(jqLite(node).scope()).not.toBe($route.current.scope); -          expect(jqLite(node).controller()).not.toBeDefined(); +          expect(angular.element(node).scope()).not.toBe($route.current.scope); +          expect(angular.element(node).controller()).not.toBeDefined();          } else if(node.nodeType == 8 /* comment node */) { -          expect(jqLite(node).scope()).toBe(element.scope()); -          expect(jqLite(node).controller()).toBe(element.controller()); +          expect(angular.element(node).scope()).toBe(element.scope()); +          expect(angular.element(node).controller()).toBe(element.controller());          } else { -          expect(jqLite(node).scope()).toBe($route.current.scope); -          expect(jqLite(node).controller()).toBeDefined(); +          expect(angular.element(node).scope()).toBe($route.current.scope); +          expect(angular.element(node).controller()).toBeDefined();          }        });      }); @@ -530,7 +530,7 @@ describe('ngView animations', function() {      // we need to run animation on attached elements;      return function(_$rootElement_) {        $rootElement = _$rootElement_; -      body = jqLite(document.body); +      body = angular.element(document.body);      };    })); @@ -541,8 +541,8 @@ describe('ngView animations', function() {    beforeEach(module(function($provide, $routeProvider) { -    $routeProvider.when('/foo', {controller: noop, templateUrl: '/foo.html'}); -    $routeProvider.when('/bar', {controller: noop, templateUrl: '/bar.html'}); +    $routeProvider.when('/foo', {controller: angular.noop, templateUrl: '/foo.html'}); +    $routeProvider.when('/bar', {controller: angular.noop, templateUrl: '/bar.html'});      return function($templateCache) {        $templateCache.put('/foo.html', [200, '<div>data</div>', {}]);        $templateCache.put('/bar.html', [200, '<div>data2</div>', {}]); | 
