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-06 12:09:17 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-06 12:09:17 +0300
commiteaea945e0355826c58c3dcf887496ea91064f85c (patch)
tree0f20e03304d35e68375e99a606b9b94483e37ee5 /spec/support
parentcce8cf03d3bebe8b05375e4db0004328f84b28a2 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/shared_contexts/project_service_shared_context.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/support/shared_contexts/project_service_shared_context.rb b/spec/support/shared_contexts/project_service_shared_context.rb
new file mode 100644
index 00000000000..89b196e7039
--- /dev/null
+++ b/spec/support/shared_contexts/project_service_shared_context.rb
@@ -0,0 +1,32 @@
+# frozen_string_literal: true
+
+shared_context 'project service activation' do
+ let(:project) { create(:project) }
+ let(:user) { create(:user) }
+
+ before do
+ project.add_maintainer(user)
+ sign_in(user)
+ end
+
+ def visit_project_integrations
+ visit project_settings_integrations_path(project)
+ end
+
+ def visit_project_integration(name)
+ visit_project_integrations
+ click_link(name)
+ end
+
+ def click_test_integration
+ click_button('Test settings and save changes')
+ end
+
+ def click_test_then_save_integration
+ click_test_integration
+
+ expect(page).to have_content('Test failed.')
+
+ click_link('Save anyway')
+ end
+end