mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-06 22:35:22 +08:00
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).
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user