Fix specs.

This commit is contained in:
Guo Xiang Tan 2016-12-21 21:21:39 +08:00
parent c897e5599a
commit 28befcb5d4
1 changed files with 5 additions and 3 deletions

View File

@ -23,7 +23,7 @@ describe "Groups" do
group_ids = response_body["groups"].map { |g| g["id"] }
expect(response_body["groups"].map { |g| g['is_group_user'] }).to eq([nil])
expect(response_body["extras"]["group_user_ids"]).to eq([])
expect(group_ids).to include(other_group.id)
expect(group_ids).to_not include(group.id)
expect(response_body["load_more_groups"]).to eq("/groups?page=1")
@ -32,7 +32,9 @@ describe "Groups" do
context 'viewing as an admin' do
it 'should display automatic groups' do
sign_in(Fabricate(:admin))
admin = Fabricate(:admin)
sign_in(admin)
group.add(admin)
get "/groups.json"
@ -42,7 +44,7 @@ describe "Groups" do
group_ids = response_body["groups"].map { |g| g["id"] }
expect(response_body["groups"].first['is_group_user']).to eq(false)
expect(response_body["extras"]["group_user_ids"]).to eq([group.id])
expect(group_ids).to include(group.id, other_group.id)
expect(response_body["load_more_groups"]).to eq("/groups?page=1")
expect(response_body["total_rows_groups"]).to eq(10)