aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorIgor Minar2011-09-15 00:44:10 +0200
committerIgor Minar2011-09-16 02:44:31 +0200
commit4e8f0d6e9ff1b852de9de9da72d0fac138bcd1a7 (patch)
treee0aeba2236ded3f34ef9f1d7c2c093f1e64dc0a7 /test
parentf9b6b614683c14a0b636a21bafb6932ab4a8aca4 (diff)
downloadangular.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).
Diffstat (limited to 'test')
-rw-r--r--test/service/locationSpec.js6
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');