diff options
| author | Igor Minar | 2011-09-15 00:44:10 +0200 |
|---|---|---|
| committer | Igor Minar | 2011-09-16 02:44:31 +0200 |
| commit | 4e8f0d6e9ff1b852de9de9da72d0fac138bcd1a7 (patch) | |
| tree | e0aeba2236ded3f34ef9f1d7c2c093f1e64dc0a7 | |
| parent | f9b6b614683c14a0b636a21bafb6932ab4a8aca4 (diff) | |
| download | angular.js-4e8f0d6e9ff1b852de9de9da72d0fac138bcd1a7.tar.bz2 | |
fix($location) $location specs must unbind document listener
link rewriting used in html5 mode on legacy browsers binds to document.onClick - we need to destroy this listener after each test to prevent test collisions (global state is evil).
| -rw-r--r-- | test/service/locationSpec.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/service/locationSpec.js b/test/service/locationSpec.js index e798aa81..a312c1b2 100644 --- a/test/service/locationSpec.js +++ b/test/service/locationSpec.js @@ -17,6 +17,12 @@ function spyOnlyCallsWithArgs(obj, method) { describe('$location', function() { var url; + afterEach(function() { + // link rewriting used in html5 mode on legacy browsers binds to document.onClick, so we need + // to clean this up after each test. + jqLite(document).unbind('click'); + }); + describe('NewUrl', function() { beforeEach(function() { url = new LocationUrl('http://www.domain.com:9877/path/b?search=a&b=c&d#hash'); |
