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

project_service_shared_context.rb « shared_contexts « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 21d67ea71a8b0687dcc35937cee12da90cdc3ed4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# frozen_string_literal: true

shared_context 'project service activation' do
  let(:project) { create(:project) }
  let(:user) { create(:user) }

  before do
    stub_feature_flags(integration_form_refactor: false)
    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_active_toggle
    find('input[name="service[active]"] + button').click
  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