Update the API tests so that it would also check data was really updated

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

The following discussion from gitlab-ee!1942 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
    end.to change { group1.name }.from(group1.name).to(new_group_name)

    expect(response).to have_http_status(200)
    expect(json_response['name']).to eq(new_group_name)
  end
end

/cc @zj @nick.thomas

Edited Sep 28, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading