Commit e06f88ef authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix specs

parent 298d05a5
...@@ -37,10 +37,10 @@ Feature: Project Services ...@@ -37,10 +37,10 @@ Feature: Project Services
And I fill Assembla settings And I fill Assembla settings
Then I should see Assembla service settings saved Then I should see Assembla service settings saved
Scenario: Activate Slack service Scenario: Activate Slack notifications service
When I visit project "Shop" services page When I visit project "Shop" services page
And I click Slack Notifications service link And I click Slack notifications service link
And I fill Slack Notifications settings And I fill Slack notifications settings
Then I should see Slack Notifications service settings saved Then I should see Slack Notifications service settings saved
Scenario: Activate Pushover service Scenario: Activate Pushover service
......
...@@ -137,11 +137,11 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps ...@@ -137,11 +137,11 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
expect(find_field('Colorize messages').value).to eq '1' expect(find_field('Colorize messages').value).to eq '1'
end end
step 'I click Slack Notifications service link' do step 'I click Slack notifications service link' do
click_link 'Slack Notifications' click_link 'Slack notifications'
end end
step 'I fill Slack Notifications settings' do step 'I fill Slack notifications settings' do
check 'Active' check 'Active'
fill_in 'Webhook', with: 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685' fill_in 'Webhook', with: 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685'
click_button 'Save' click_button 'Save'
......
...@@ -12,37 +12,29 @@ feature 'Slack slash commands', feature: true do ...@@ -12,37 +12,29 @@ feature 'Slack slash commands', feature: true do
login_as(user) login_as(user)
end end
scenario 'user visits the slack slash command config page', js: true do scenario 'user visits the slack slash command config page and shows a help message', js: true do
it 'shows a help message' do visit edit_namespace_project_service_path(project.namespace, project, service)
visit edit_namespace_project_service_path(project.namespace, project, service)
wait_for_ajax wait_for_ajax
expect(page).to have_content('This service allows GitLab users to perform common') expect(page).to have_content('This service allows GitLab users to perform common')
end
end end
scenario 'saving a token' do scenario 'shows the token after saving' do
given(:token) { ('a'..'z').to_a.join } visit edit_namespace_project_service_path(project.namespace, project, service)
it 'shows the token after saving' do fill_in 'service_token', with: 'token'
visit edit_namespace_project_service_path(project.namespace, project, service) click_on 'Save'
fill_in 'service_token', with: token value = find_field('service_token').value
click_on 'Save'
value = find_field('service_token').value expect(value).to eq('token')
expect(value).to eq(token)
end
end end
scenario 'the trigger url' do scenario 'shows the correct trigger url' do
it 'shows the correct url' do visit edit_namespace_project_service_path(project.namespace, project, service)
visit edit_namespace_project_service_path(project.namespace, project, service)
value = find_field('url').value value = find_field('url').value
expect(value).to match("api/v3/projects/#{project.id}/services/slack_slash_commands/trigger") expect(value).to match("api/v3/projects/#{project.id}/services/slack_slash_commands/trigger")
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment