2020-04-22 19:07:51 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.shared_context 'project service activation' do
|
2020-04-22 19:07:51 +05:30
|
|
|
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
|
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
def click_active_toggle
|
|
|
|
find('input[name="service[active]"] + button').click
|
|
|
|
end
|
|
|
|
|
2020-04-22 19:07:51 +05:30
|
|
|
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
|