diff options
author | Jarka Kadlecova <jarka@gitlab.com> | 2017-05-22 12:07:12 +0200 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-06-01 07:47:15 +0200 |
commit | 33d82ccb453ef020d28f1307be1a3a97130c9e0b (patch) | |
tree | 11884c9d626b30777695193443a7e4873f7a7e49 /spec/features/projects | |
parent | dd0f8b8ccc3b5f61e31703f7391a919b702934a5 (diff) | |
download | gitlab-ce-33d82ccb453ef020d28f1307be1a3a97130c9e0b.tar.gz |
simplify test&save actions when setting a service integration
Diffstat (limited to 'spec/features/projects')
-rw-r--r-- | spec/features/projects/services/mattermost_slash_command_spec.rb | 16 | ||||
-rw-r--r-- | spec/features/projects/services/slack_slash_command_spec.rb | 14 |
2 files changed, 24 insertions, 6 deletions
diff --git a/spec/features/projects/services/mattermost_slash_command_spec.rb b/spec/features/projects/services/mattermost_slash_command_spec.rb index dc3854262e7..bb12f64a552 100644 --- a/spec/features/projects/services/mattermost_slash_command_spec.rb +++ b/spec/features/projects/services/mattermost_slash_command_spec.rb @@ -24,15 +24,25 @@ feature 'Setup Mattermost slash commands', :feature, :js do expect(token_placeholder).to eq('XXxxXXxxXXxxXXxxXXxxXXxx') end - it 'shows the token after saving' do + it 'redirects to the integrations page after saving but not activating' do token = ('a'..'z').to_a.join fill_in 'service_token', with: token click_on 'Save' - value = find_field('service_token').value + expect(current_path).to eq(namespace_project_settings_integrations_path(project.namespace, project)) + expect(page).to have_content('Mattermost slash commands settings saved, but not activated.') + end + + it 'redirects to the integrations page after activating' do + token = ('a'..'z').to_a.join + + fill_in 'service_token', with: token + check 'service_active' + click_on 'Save' - expect(value).to eq(token) + expect(current_path).to eq(namespace_project_settings_integrations_path(project.namespace, project)) + expect(page).to have_content(' Mattermost slash commands activated.') end it 'shows the add to mattermost button' do diff --git a/spec/features/projects/services/slack_slash_command_spec.rb b/spec/features/projects/services/slack_slash_command_spec.rb index db903a0c8f0..f53b820c460 100644 --- a/spec/features/projects/services/slack_slash_command_spec.rb +++ b/spec/features/projects/services/slack_slash_command_spec.rb @@ -21,13 +21,21 @@ feature 'Slack slash commands', feature: true do expect(page).to have_content('This service allows users to perform common') end - it 'shows the token after saving' do + it 'redirects to the integrations page after saving but not activating' do fill_in 'service_token', with: 'token' click_on 'Save' - value = find_field('service_token').value + expect(current_path).to eq(namespace_project_settings_integrations_path(project.namespace, project)) + expect(page).to have_content('Slack slash commands settings saved, but not activated.') + end + + it 'redirects to the integrations page after activating' do + fill_in 'service_token', with: 'token' + check 'service_active' + click_on 'Save' - expect(value).to eq('token') + expect(current_path).to eq(namespace_project_settings_integrations_path(project.namespace, project)) + expect(page).to have_content('Slack slash commands activated.') end it 'shows the correct trigger url' do |