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

test(ngMock.$httpBackend): add tests for the existence of when shortcut methods #9322

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions test/ngMock/angular-mocksSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,17 @@ describe('ngMock', function() {
expect(typeof hb.expectHEAD).toBe("function");
});


it('should provide "when" methods for each HTTP verb', function() {
expect(typeof hb.whenGET).toBe("function");
expect(typeof hb.whenPOST).toBe("function");
expect(typeof hb.whenPUT).toBe("function");
expect(typeof hb.whenPATCH).toBe("function");
expect(typeof hb.whenDELETE).toBe("function");
expect(typeof hb.whenHEAD).toBe("function");
});


it('should respond with first matched definition', function() {
hb.when('GET', '/url1').respond(200, 'content', {});
hb.when('GET', '/url1').respond(201, 'another', {});
Expand Down