mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-28 11:56:03 +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() {
|
describe('$location', function() {
|
||||||
var url;
|
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() {
|
describe('NewUrl', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
url = new LocationUrl('http://www.domain.com:9877/path/b?search=a&b=c&d#hash');
|
url = new LocationUrl('http://www.domain.com:9877/path/b?search=a&b=c&d#hash');
|
||||||
|
|||||||
Reference in New Issue
Block a user