Skip to content

Commit

Permalink
Clan search and list now return autojoin and allowapplication
Browse files Browse the repository at this point in the history
  • Loading branch information
heynemann committed Jul 7, 2016
1 parent 3a6f818 commit f6a65ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 5 additions & 3 deletions api/clan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions api/clan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
})

Expand Down Expand Up @@ -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)
}
})
})
Expand Down

0 comments on commit f6a65ff

Please sign in to comment.