Files
habitica/test/spec/groupServicesSpec.js
T
Kevin Gisi 09b6401794 Add translations to Karma specs
* Added a task to Gruntfile to use website/src/i18n.js to generate a small JS file to be loaded in Karma env which sets window.env.translations to the i18n.translations['en'].

* Added new Grunt task to build:dev

* Updated Karma specs to reenable testing where possible, updating comments where not.
2015-03-24 21:39:03 -04:00

39 lines
985 B
JavaScript

'use strict';
// @TODO the requests via $resource seem to be
// doing a full page reload which breaks the specs
xdescribe('groupServices', function() {
var $httpBackend, groups;
beforeEach(inject(function(_$httpBackend_, Groups) {
$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();
});
});