2013-11-16 01:15:11 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
2015-03-23 01:33:01 +00:00
|
|
|
describe('groupServices', function() {
|
|
|
|
|
var $httpBackend, $http, groups;
|
2015-03-07 21:48:23 +00:00
|
|
|
|
2015-03-23 01:33:01 +00:00
|
|
|
beforeEach(function() {
|
|
|
|
|
module(function($provide) {
|
|
|
|
|
$provide.value('User', {});
|
|
|
|
|
});
|
2013-11-16 01:15:11 +00:00
|
|
|
|
2015-03-23 01:33:01 +00:00
|
|
|
inject(function(_$httpBackend_, Groups, User) {
|
2013-11-16 01:15:11 +00:00
|
|
|
$httpBackend = _$httpBackend_;
|
|
|
|
|
groups = Groups;
|
2015-03-23 01:33:01 +00:00
|
|
|
});
|
|
|
|
|
});
|
2013-11-16 01:15:11 +00:00
|
|
|
|
|
|
|
|
it('calls party endpoint', function() {
|
2015-03-05 18:43:03 +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() {
|
2015-03-05 18:43:03 +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();
|
|
|
|
|
});
|
|
|
|
|
|
2015-03-05 18:43:03 +00:00
|
|
|
});
|