diff options
Diffstat (limited to 'test/angular-mocks.js')
| -rw-r--r-- | test/angular-mocks.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/angular-mocks.js b/test/angular-mocks.js new file mode 100644 index 00000000..ab3638b1 --- /dev/null +++ b/test/angular-mocks.js @@ -0,0 +1,26 @@ + +function MockBrowser() { + this.url = "http://server"; + this.watches = []; +} +MockBrowser.prototype = { + xhr: function(method, url, callback) { + + }, + + getUrl: function(){ + return this.url; + }, + + setUrl: function(url){ + this.url = url; + }, + + watchUrl: function(fn) { + this.watches.push(fn); + } +}; + +angular.service('$browser', function(){ + return new MockBrowser(); +}); |
