Files
habitica/test/spec/groupServicesSpec.js
Kevin Gisi 2194caec15 Repaired groupServicesSpec, uncommented specs.
As it turns out, the page reload behavior was not caused by $resource, but
exists somewhere within the User module. Stubbed out the User module as as done
in notificationServicesSpec
2015-03-24 21:39:03 -04:00

42 lines
997 B
JavaScript

'use strict';
describe('groupServices', function() {
var $httpBackend, $http, groups;
beforeEach(function() {
module(function($provide) {
$provide.value('User', {});
});
inject(function(_$httpBackend_, Groups, User) {
$httpBackend = _$httpBackend_;
groups = Groups;
});
});
it('calls party endpoint', function() {
$httpBackend.expectGET('/api/v2/groups/party').respond({});
groups.party();
$httpBackend.flush();
});
it('calls tavern endpoint', function() {
$httpBackend.expectGET('/api/v2/groups/habitrpg').respond({});
groups.tavern();
$httpBackend.flush();
});
it('calls public guilds endpoint', function() {
$httpBackend.expectGET('/api/v2/groups?type=public').respond([]);
groups.publicGuilds();
$httpBackend.flush();
});
it('calls my guilds endpoint', function() {
$httpBackend.expectGET('/api/v2/groups?type=guilds').respond([]);
groups.myGuilds();
$httpBackend.flush();
});
});