Commit d2600046 authored by Justin Ho's avatar Justin Ho

Move spec from ff to be inside owner context

The spec to test not_found bahviour should be inside
the "when use is owner" context so it doesn't overlap
with the conditions checking if user is owner. This
makes the test more solid that it is testing for the
right condition.
parent 2492d4fe
......@@ -12,16 +12,6 @@ describe Groups::Settings::IntegrationsController do
end
describe '#index' do
context 'when group_level_integrations not enabled' do
it 'returns not_found' do
stub_feature_flags(group_level_integrations: { enabled: false, thing: group })
get :index, params: { group_id: group }
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'when user is not owner' do
it 'renders not_found' do
get :index, params: { group_id: group }
......@@ -35,6 +25,16 @@ describe Groups::Settings::IntegrationsController do
group.add_owner(user)
end
context 'when group_level_integrations not enabled' do
it 'returns not_found' do
stub_feature_flags(group_level_integrations: { enabled: false, thing: group })
get :index, params: { group_id: group }
expect(response).to have_gitlab_http_status(:not_found)
end
end
it 'successfully displays the template' do
get :index, params: { group_id: group }
......@@ -45,16 +45,6 @@ describe Groups::Settings::IntegrationsController do
end
describe '#edit' do
context 'when group_level_integrations not enabled' do
it 'returns not_found' do
stub_feature_flags(group_level_integrations: { enabled: false, thing: group })
get :edit, params: { group_id: group, id: Service.available_services_names.sample }
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'when user is not owner' do
it 'renders not_found' do
get :edit, params: { group_id: group, id: Service.available_services_names.sample }
......@@ -68,6 +58,16 @@ describe Groups::Settings::IntegrationsController do
group.add_owner(user)
end
context 'when group_level_integrations not enabled' do
it 'returns not_found' do
stub_feature_flags(group_level_integrations: { enabled: false, thing: group })
get :edit, params: { group_id: group, id: Service.available_services_names.sample }
expect(response).to have_gitlab_http_status(:not_found)
end
end
Service.available_services_names.each do |integration_name|
context "#{integration_name}" do
it 'successfully displays the template' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment