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

39 lines
985 B
JavaScript
Raw Normal View History

2013-11-16 01:15:11 +00:00
'use strict';
// @TODO the requests via $resource seem to be
// doing a full page reload which breaks the specs
xdescribe('groupServices', function() {
2013-11-16 01:15:11 +00:00
var $httpBackend, groups;
beforeEach(inject(function(_$httpBackend_, Groups) {
$httpBackend = _$httpBackend_;
groups = Groups;
}));
it('calls party endpoint', function() {
$httpBackend.expectGET('/api/v2/groups/party').respond({});
2013-11-16 01:15:11 +00:00
groups.party();
$httpBackend.flush();
});
it('calls tavern endpoint', function() {
$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();
});
});