Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 9e0ab14

Browse files
gkalpakIgorMinar
authored andcommitted
test(ngMock.$httpBackend): add tests for the existence of when shortcut methods
Closes #9322
1 parent e499433 commit 9e0ab14

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/ngMock/angular-mocksSpec.js

+11
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,17 @@ describe('ngMock', function() {
889889
expect(typeof hb.expectHEAD).toBe("function");
890890
});
891891

892+
893+
it('should provide "when" methods for each HTTP verb', function() {
894+
expect(typeof hb.whenGET).toBe("function");
895+
expect(typeof hb.whenPOST).toBe("function");
896+
expect(typeof hb.whenPUT).toBe("function");
897+
expect(typeof hb.whenPATCH).toBe("function");
898+
expect(typeof hb.whenDELETE).toBe("function");
899+
expect(typeof hb.whenHEAD).toBe("function");
900+
});
901+
902+
892903
it('should respond with first matched definition', function() {
893904
hb.when('GET', '/url1').respond(200, 'content', {});
894905
hb.when('GET', '/url1').respond(201, 'another', {});

0 commit comments

Comments
 (0)