aboutsummaryrefslogtreecommitdiffstats
path: root/test/angular-mocks.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/angular-mocks.js')
-rw-r--r--test/angular-mocks.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/angular-mocks.js b/test/angular-mocks.js
index fd53a189..5a4e1de5 100644
--- a/test/angular-mocks.js
+++ b/test/angular-mocks.js
@@ -63,8 +63,23 @@ function MockBrowser() {
this.isMock = true;
self.url = "http://server";
+ self.lastUrl = self.url; // used by url polling fn
self.pollFns = [];
+
+ // register url polling fn
+
+ self.onHashChange = function(listener) {
+ self.pollFns.push(
+ function() {
+ if (self.lastUrl != self.url) {
+ listener();
+ }
+ }
+ );
+ };
+
+
self.xhr = function(method, url, data, callback) {
if (angular.isFunction(data)) {
callback = data;