Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-08 21:09:16 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-08 21:09:16 +0300
commit80e9fdc9682cfbcfb9202a2733605a6a6bd23f05 (patch)
tree168375ea13d1a1f01d4cbcf6f0513fc9883e9477 /spec/controllers
parent5372e109c0660e4670aa987568a51082beca1b3c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/groups/settings/integrations_controller_spec.rb45
1 files changed, 39 insertions, 6 deletions
diff --git a/spec/controllers/groups/settings/integrations_controller_spec.rb b/spec/controllers/groups/settings/integrations_controller_spec.rb
index eee65476dab..6df1ad8a383 100644
--- a/spec/controllers/groups/settings/integrations_controller_spec.rb
+++ b/spec/controllers/groups/settings/integrations_controller_spec.rb
@@ -11,17 +11,40 @@ describe Groups::Settings::IntegrationsController do
sign_in(user)
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 }
+ describe '#index' do
+ context 'when user is not owner' do
+ it 'renders not_found' do
+ get :index, params: { group_id: group }
expect(response).to have_gitlab_http_status(:not_found)
end
end
+ context 'when user is owner' do
+ before 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 }
+
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(response).to render_template(:index)
+ end
+ end
+ end
+
+ describe '#edit' do
context 'when user is not owner' do
it 'renders not_found' do
get :edit, params: { group_id: group, id: Service.available_services_names.sample }
@@ -35,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