diff options
Diffstat (limited to 'spec/features/projects')
5 files changed, 9 insertions, 12 deletions
diff --git a/spec/features/projects/services/user_activates_issue_tracker_spec.rb b/spec/features/projects/services/user_activates_issue_tracker_spec.rb index 0b0a3362043..4f3fb6ac3bf 100644 --- a/spec/features/projects/services/user_activates_issue_tracker_spec.rb +++ b/spec/features/projects/services/user_activates_issue_tracker_spec.rb @@ -9,7 +9,7 @@ describe 'User activates issue tracker', :js do let(:url) { 'http://tracker.example.com' } def fill_short_form(disabled: false) - uncheck 'Active' if disabled + find('input[name="service[active]"] + button').click if disabled fill_in 'service_project_url', with: url fill_in 'service_issues_url', with: "#{url}/:id" diff --git a/spec/features/projects/services/user_activates_jira_spec.rb b/spec/features/projects/services/user_activates_jira_spec.rb index 557615f8872..fb9628032b2 100644 --- a/spec/features/projects/services/user_activates_jira_spec.rb +++ b/spec/features/projects/services/user_activates_jira_spec.rb @@ -10,7 +10,7 @@ describe 'User activates Jira', :js do let(:test_url) { 'http://jira.example.com/rest/api/2/serverInfo' } def fill_form(disabled: false) - uncheck 'Active' if disabled + find('input[name="service[active]"] + button').click if disabled fill_in 'service_url', with: url fill_in 'service_username', with: 'username' @@ -53,7 +53,6 @@ describe 'User activates Jira', :js do it 'shows errors when some required fields are not filled in' do click_link('Jira') - check 'Active' fill_in 'service_password', with: 'password' click_button('Test settings and save changes') diff --git a/spec/features/projects/services/user_activates_mattermost_slash_command_spec.rb b/spec/features/projects/services/user_activates_mattermost_slash_command_spec.rb index 2eaa2d24c4b..ac9cb00be84 100644 --- a/spec/features/projects/services/user_activates_mattermost_slash_command_spec.rb +++ b/spec/features/projects/services/user_activates_mattermost_slash_command_spec.rb @@ -5,14 +5,13 @@ require 'spec_helper' describe 'Set up Mattermost slash commands', :js do let(:user) { create(:user) } let(:project) { create(:project) } - let(:service) { project.create_mattermost_slash_commands_service } let(:mattermost_enabled) { true } before do stub_mattermost_setting(enabled: mattermost_enabled) project.add_maintainer(user) sign_in(user) - visit edit_project_service_path(project, service) + visit edit_project_service_path(project, :mattermost_slash_commands) end describe 'user visits the mattermost slash command config page' do @@ -30,6 +29,7 @@ describe 'Set up Mattermost slash commands', :js do token = ('a'..'z').to_a.join fill_in 'service_token', with: token + find('input[name="service[active]"] + button').click click_on 'Save changes' expect(current_path).to eq(project_settings_integrations_path(project)) @@ -40,7 +40,6 @@ describe 'Set up Mattermost slash commands', :js do token = ('a'..'z').to_a.join fill_in 'service_token', with: token - check 'service_active' click_on 'Save changes' expect(current_path).to eq(project_settings_integrations_path(project)) diff --git a/spec/features/projects/services/user_activates_slack_slash_command_spec.rb b/spec/features/projects/services/user_activates_slack_slash_command_spec.rb index 752ef8d592d..4ce1acd9377 100644 --- a/spec/features/projects/services/user_activates_slack_slash_command_spec.rb +++ b/spec/features/projects/services/user_activates_slack_slash_command_spec.rb @@ -5,12 +5,11 @@ require 'spec_helper' describe 'Slack slash commands' do let(:user) { create(:user) } let(:project) { create(:project) } - let(:service) { project.create_slack_slash_commands_service } before do project.add_maintainer(user) sign_in(user) - visit edit_project_service_path(project, service) + visit edit_project_service_path(project, :slack_slash_commands) end it 'shows a token placeholder' do @@ -23,17 +22,17 @@ describe 'Slack slash commands' do expect(page).to have_content('This service allows users to perform common') end - it 'redirects to the integrations page after saving but not activating' do + it 'redirects to the integrations page after saving but not activating', :js do fill_in 'service_token', with: 'token' + find('input[name="service[active]"] + button').click click_on 'Save' expect(current_path).to eq(project_settings_integrations_path(project)) expect(page).to have_content('Slack slash commands settings saved, but not activated.') end - it 'redirects to the integrations page after activating' do + it 'redirects to the integrations page after activating', :js do fill_in 'service_token', with: 'token' - check 'service_active' click_on 'Save' expect(current_path).to eq(project_settings_integrations_path(project)) diff --git a/spec/features/projects/services/user_activates_youtrack_spec.rb b/spec/features/projects/services/user_activates_youtrack_spec.rb index 2f6aad1d736..26734766ff0 100644 --- a/spec/features/projects/services/user_activates_youtrack_spec.rb +++ b/spec/features/projects/services/user_activates_youtrack_spec.rb @@ -9,7 +9,7 @@ describe 'User activates issue tracker', :js do let(:url) { 'http://tracker.example.com' } def fill_form(disabled: false) - uncheck 'Active' if disabled + find('input[name="service[active]"] + button').click if disabled fill_in 'service_project_url', with: url fill_in 'service_issues_url', with: "#{url}/:id" |