From 4853c0814d3632a6ffabb7c73934d055797b8522 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Thu, 16 Apr 2015 07:39:55 -0500 Subject: [PATCH] Corrected function --- test/spec/groupCtrlSpec.js | 4 ++-- website/public/js/controllers/groupsCtrl.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/spec/groupCtrlSpec.js b/test/spec/groupCtrlSpec.js index 503d1e21a8..e59d4ffe29 100644 --- a/test/spec/groupCtrlSpec.js +++ b/test/spec/groupCtrlSpec.js @@ -1,6 +1,6 @@ 'use strict'; -describe('Groups Controller', function() { +describe.only('Groups Controller', function() { var scope, ctrl, groups, user, guild, $rootScope; beforeEach(function() { @@ -48,7 +48,7 @@ describe('Groups Controller', function() { return []; }); - expect(scope.isMemberOfGroup(user._id, guild)).to.not.be.eql(true); + expect(scope.isMemberOfGroup(user._id, guild)).to.be.eql(false); expect(myGuilds).to.be.called }); }); diff --git a/website/public/js/controllers/groupsCtrl.js b/website/public/js/controllers/groupsCtrl.js index 50d137da3a..334ebca87d 100644 --- a/website/public/js/controllers/groupsCtrl.js +++ b/website/public/js/controllers/groupsCtrl.js @@ -20,7 +20,7 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', ' // If the group is a guild, just check for an intersection with the // current user's guilds, rather than checking the members of the group. if(group.type === 'guild') { - return _.detect(Groups.myGuilds(), function(g) { return g._id === group._id }); + return _.detect(Groups.myGuilds(), function(g) { return g._id === group._id }) ? true : false; } if (!group.members) return false;