habitica-self-host/test/spec/groupServicesSpec.js

38 lines
962 B
JavaScript
Raw Normal View History

2013-11-16 01:15:11 +00:00
'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() {
2013-12-24 01:38:15 +00:00
$httpBackend.expectGET('/api/v2/groups/party?').respond({});
2013-11-16 01:15:11 +00:00
groups.party();
$httpBackend.flush();
});
it('calls tavern endpoint', function() {
2013-12-24 01:38:15 +00:00
$httpBackend.expectGET('/api/v2/groups/habitrpg?').respond({});
2013-11-16 01:15:11 +00:00
groups.tavern();
$httpBackend.flush();
});
it('calls public guilds endpoint', function() {
2013-12-24 01:38:15 +00:00
$httpBackend.expectGET('/api/v2/groups?type=public').respond([]);
2013-11-16 01:15:11 +00:00
groups.publicGuilds();
$httpBackend.flush();
});
it('calls my guilds endpoint', function() {
2013-12-24 01:38:15 +00:00
$httpBackend.expectGET('/api/v2/groups?type=guilds').respond([]);
2013-11-16 01:15:11 +00:00
groups.myGuilds();
$httpBackend.flush();
});
});