aboutsummaryrefslogtreecommitdiffstats
path: root/test/ngMock/angular-mocksSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/ngMock/angular-mocksSpec.js')
-rw-r--r--test/ngMock/angular-mocksSpec.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ngMock/angular-mocksSpec.js b/test/ngMock/angular-mocksSpec.js
index c2b6108d..b3608013 100644
--- a/test/ngMock/angular-mocksSpec.js
+++ b/test/ngMock/angular-mocksSpec.js
@@ -1431,6 +1431,17 @@ describe('ngMock', function() {
});
+ it('should accept url as function', function() {
+ var urlValidator = function(url) {
+ return url !== '/not-accepted';
+ };
+ var exp = new MockHttpExpectation('POST', urlValidator);
+
+ expect(exp.match('POST', '/url')).toBe(true);
+ expect(exp.match('POST', '/not-accepted')).toBe(false);
+ });
+
+
it('should accept data as regexp', function() {
var exp = new MockHttpExpectation('POST', '/url', /\{.*?\}/);