From f6a65ff9defe4ee5e26182f84900c3ed6547fd4f Mon Sep 17 00:00:00 2001 From: Bernardo Heynemann Date: Thu, 7 Jul 2016 16:01:40 -0300 Subject: [PATCH] Clan search and list now return autojoin and allowapplication --- api/clan.go | 8 +++++--- api/clan_test.go | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/api/clan.go b/api/clan.go index 9e687f6c..840003e4 100644 --- a/api/clan.go +++ b/api/clan.go @@ -294,9 +294,11 @@ func serializeClans(clans []models.Clan, includePublicID bool) []util.JSON { func serializeClan(clan *models.Clan, includePublicID bool) util.JSON { serial := util.JSON{ - "name": clan.Name, - "metadata": clan.Metadata, - "membershipCount": clan.MembershipCount, + "name": clan.Name, + "metadata": clan.Metadata, + "allowApplication": clan.AllowApplication, + "autoJoin": clan.AutoJoin, + "membershipCount": clan.MembershipCount, } if includePublicID { diff --git a/api/clan_test.go b/api/clan_test.go index 7198bd52..dfe4e416 100644 --- a/api/clan_test.go +++ b/api/clan_test.go @@ -371,6 +371,8 @@ func TestClanHandler(t *testing.T) { } g.Assert(clan["publicID"]).Equal(expectedClans[index].PublicID) g.Assert(clan["ID"]).Equal(nil) + g.Assert(clan["autoJoin"]).Equal(expectedClans[index].AutoJoin) + g.Assert(clan["allowApplication"]).Equal(expectedClans[index].AllowApplication) } }) @@ -493,6 +495,8 @@ func TestClanHandler(t *testing.T) { clan := clans[index].(map[string]interface{}) // Can't be util.JSON g.Assert(clan["name"]).Equal(expectedClan.Name) g.Assert(int(clan["membershipCount"].(float64))).Equal(expectedClan.MembershipCount) + g.Assert(clan["autoJoin"]).Equal(expectedClan.AutoJoin) + g.Assert(clan["allowApplication"]).Equal(expectedClan.AllowApplication) } }) })