diff options
Diffstat (limited to 'spec/requests/api/groups_spec.rb')
-rw-r--r-- | spec/requests/api/groups_spec.rb | 41 |
1 files changed, 11 insertions, 30 deletions
diff --git a/spec/requests/api/groups_spec.rb b/spec/requests/api/groups_spec.rb index 1c359b6e50f..0a47b93773b 100644 --- a/spec/requests/api/groups_spec.rb +++ b/spec/requests/api/groups_spec.rb @@ -506,7 +506,7 @@ RSpec.describe API::Groups do end it "does not return a non existing group" do - get api("/groups/1328", user1) + get api("/groups/#{non_existing_record_id}", user1) expect(response).to have_gitlab_http_status(:not_found) end @@ -586,7 +586,7 @@ RSpec.describe API::Groups do end it "does not return a non existing group" do - get api("/groups/1328", admin) + get api("/groups/#{non_existing_record_id}", admin) expect(response).to have_gitlab_http_status(:not_found) end @@ -631,30 +631,11 @@ RSpec.describe API::Groups do end end - context 'when limiting feature is enabled' do - before do - stub_feature_flags(limit_projects_in_groups_api: true) - end - - it 'limits projects and shared_projects' do - get api("/groups/#{group1.id}") - - expect(json_response['projects'].count).to eq(limit) - expect(json_response['shared_projects'].count).to eq(limit) - end - end - - context 'when limiting feature is not enabled' do - before do - stub_feature_flags(limit_projects_in_groups_api: false) - end - - it 'does not limit projects and shared_projects' do - get api("/groups/#{group1.id}") + it 'limits projects and shared_projects' do + get api("/groups/#{group1.id}") - expect(json_response['projects'].count).to eq(3) - expect(json_response['shared_projects'].count).to eq(3) - end + expect(json_response['projects'].count).to eq(limit) + expect(json_response['shared_projects'].count).to eq(limit) end end end @@ -748,7 +729,7 @@ RSpec.describe API::Groups do end it 'returns 404 for a non existing group' do - put api('/groups/1328', user1), params: { name: new_group_name } + put api("/groups/#{non_existing_record_id}", user1), params: { name: new_group_name } expect(response).to have_gitlab_http_status(:not_found) end @@ -973,7 +954,7 @@ RSpec.describe API::Groups do end it "does not return a non existing group" do - get api("/groups/1328/projects", user1) + get api("/groups/#{non_existing_record_id}/projects", user1) expect(response).to have_gitlab_http_status(:not_found) end @@ -1027,7 +1008,7 @@ RSpec.describe API::Groups do end it "does not return a non existing group" do - get api("/groups/1328/projects", admin) + get api("/groups/#{non_existing_record_id}/projects", admin) expect(response).to have_gitlab_http_status(:not_found) end @@ -1686,7 +1667,7 @@ RSpec.describe API::Groups do end it "does not remove a non existing group" do - delete api("/groups/1328", user1) + delete api("/groups/#{non_existing_record_id}", user1) expect(response).to have_gitlab_http_status(:not_found) end @@ -1706,7 +1687,7 @@ RSpec.describe API::Groups do end it "does not remove a non existing group" do - delete api("/groups/1328", admin) + delete api("/groups/#{non_existing_record_id}", admin) expect(response).to have_gitlab_http_status(:not_found) end |