mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-21 21:28:52 +00:00
add tests for groupServices
This commit is contained in:
parent
05334550b0
commit
2f5025e322
1 changed files with 38 additions and 0 deletions
38
test/spec/groupServicesSpec.js
Normal file
38
test/spec/groupServicesSpec.js
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
'use strict';
|
||||
|
||||
describe('groupServices', function() {
|
||||
var $httpBackend, groups;
|
||||
|
||||
beforeEach(module('groupServices'));
|
||||
beforeEach(module('habitrpg'));
|
||||
|
||||
beforeEach(inject(function(_$httpBackend_, Groups) {
|
||||
$httpBackend = _$httpBackend_;
|
||||
groups = Groups;
|
||||
}));
|
||||
|
||||
it('calls party endpoint', function() {
|
||||
$httpBackend.expectGET('/api/v1/groups/party?').respond({});
|
||||
groups.party();
|
||||
$httpBackend.flush();
|
||||
});
|
||||
|
||||
it('calls tavern endpoint', function() {
|
||||
$httpBackend.expectGET('/api/v1/groups/habitrpg?').respond({});
|
||||
groups.tavern();
|
||||
$httpBackend.flush();
|
||||
});
|
||||
|
||||
it('calls public guilds endpoint', function() {
|
||||
$httpBackend.expectGET('/api/v1/groups?type=public').respond([]);
|
||||
groups.publicGuilds();
|
||||
$httpBackend.flush();
|
||||
});
|
||||
|
||||
it('calls my guilds endpoint', function() {
|
||||
$httpBackend.expectGET('/api/v1/groups?type=guilds').respond([]);
|
||||
groups.myGuilds();
|
||||
$httpBackend.flush();
|
||||
});
|
||||
|
||||
});
|
||||
Loading…
Reference in a new issue