From 2f5025e32255a6701bd27509a873d7fc1b8e435f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Jureti=C4=87?= Date: Fri, 15 Nov 2013 22:15:11 -0300 Subject: [PATCH] add tests for groupServices --- test/spec/groupServicesSpec.js | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 test/spec/groupServicesSpec.js diff --git a/test/spec/groupServicesSpec.js b/test/spec/groupServicesSpec.js new file mode 100644 index 0000000000..d0206b2f54 --- /dev/null +++ b/test/spec/groupServicesSpec.js @@ -0,0 +1,38 @@ +'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() { + $httpBackend.expectGET('/api/v1/groups/party?').respond({}); + groups.party(); + $httpBackend.flush(); + }); + + it('calls tavern endpoint', function() { + $httpBackend.expectGET('/api/v1/groups/habitrpg?').respond({}); + groups.tavern(); + $httpBackend.flush(); + }); + + it('calls public guilds endpoint', function() { + $httpBackend.expectGET('/api/v1/groups?type=public').respond([]); + groups.publicGuilds(); + $httpBackend.flush(); + }); + + it('calls my guilds endpoint', function() { + $httpBackend.expectGET('/api/v1/groups?type=guilds').respond([]); + groups.myGuilds(); + $httpBackend.flush(); + }); + +}); \ No newline at end of file