mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00: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:
parent
f9b6b61468
commit
4e8f0d6e9f
1 changed files with 6 additions and 0 deletions
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in a new issue