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

Commit b2129e7

Browse files
committed
test(ngMock.$httpBackend): add tests for the existence of when shortcut methods
1 parent b119251 commit b2129e7

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
@@ -894,6 +894,17 @@ describe('ngMock', function() {
894894
expect(typeof hb.expectHEAD).toBe("function");
895895
});
896896

897+
898+
it('should provide "when" methods for each HTTP verb', function() {
899+
expect(typeof hb.whenGET).toBe("function");
900+
expect(typeof hb.whenPOST).toBe("function");
901+
expect(typeof hb.whenPUT).toBe("function");
902+
expect(typeof hb.whenPATCH).toBe("function");
903+
expect(typeof hb.whenDELETE).toBe("function");
904+
expect(typeof hb.whenHEAD).toBe("function");
905+
});
906+
907+
897908
it('should respond with first matched definition', function() {
898909
hb.when('GET', '/url1').respond(200, 'content', {});
899910
hb.when('GET', '/url1').respond(201, 'another', {});

0 commit comments

Comments
 (0)