mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 15:34:16 +08:00
checking actual values in the spec, not just counts
This commit is contained in:
parent
adb570fe53
commit
610c2a4d65
|
@ -70,16 +70,17 @@ describe GroupsController do
|
|||
|
||||
it "ensures that membership can be paginated" do
|
||||
5.times { group.add(Fabricate(:user)) }
|
||||
usernames = group.users.map{ |m| m['username'] }.sort
|
||||
|
||||
xhr :get, :members, group_id: group.name, limit: 3
|
||||
response.should be_success
|
||||
members = JSON.parse(response.body)
|
||||
members.count.should eq(3)
|
||||
members.map{ |m| m['username'] }.should eq(usernames[0..2])
|
||||
|
||||
xhr :get, :members, group_id: group.name, limit: 250, offset: 250
|
||||
xhr :get, :members, group_id: group.name, limit: 3, offset: 3
|
||||
response.should be_success
|
||||
members = JSON.parse(response.body)
|
||||
members.count.should eq(2)
|
||||
members.map{ |m| m['username'] }.should eq(usernames[3..4])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user