Fix group_member_spec to not leak information

This commit is contained in:
Robert Schilling 2016-04-13 12:10:12 +02:00
parent ca40479c51
commit 4cd04443f5

View file

@ -42,9 +42,10 @@ describe API::API, api: true do
end
end
it "users not part of the group should get access error" do
it 'users not part of the group should get access error' do
get api("/groups/#{group_with_members.id}/members", stranger)
expect(response.status).to eq(403)
expect(response.status).to eq(404)
end
end
end
@ -165,12 +166,13 @@ describe API::API, api: true do
end
end
describe "DELETE /groups/:id/members/:user_id" do
context "when not a member of the group" do
describe 'DELETE /groups/:id/members/:user_id' do
context 'when not a member of the group' do
it "should not delete guest's membership of group_with_members" do
random_user = create(:user)
delete api("/groups/#{group_with_members.id}/members/#{owner.id}", random_user)
expect(response.status).to eq(403)
expect(response.status).to eq(404)
end
end