Update the API tests so that it would also check data was really updated
The following discussion from !1942 (merged) should be addressed:
-
@grzesiek started a discussion: (+7 comments)
Should we check if
group1
indeed has a new value of quota limit?
Files we should update:
-
spec/requests/api/groups_spec.rb
Example:
Change this:
context 'when authenticated as the admin' do
it 'updates the group' do
put api("/groups/#{group1.id}", admin), name: new_group_name
expect(response).to have_http_status(200)
expect(json_response['name']).to eq(new_group_name)
end
end
To this:
context 'when authenticated as the admin' do
it 'updates the group' do
expect do
put api("/groups/#{group1.id}", admin), name: new_group_name
expect(response).to have_http_status(200)
expect(json_response['name']).to eq(new_group_name)
end.to change { group1.name }.from(group1.name).to(new_group_name)
end
end
/cc @zj @nick.thomas