debian-mirror-gitlab/spec/features/projects/integrations/user_activates_slack_slash_command_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.5 KiB
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
require 'spec_helper'
2020-06-23 00:09:42 +05:30
RSpec.describe 'Slack slash commands', :js do
2022-04-04 11:22:00 +05:30
include_context 'project integration activation'
2017-08-17 22:00:37 +05:30
2018-11-08 19:23:39 +05:30
before do
2020-05-24 23:13:21 +05:30
visit_project_integration('Slack slash commands')
2017-08-17 22:00:37 +05:30
end
it 'shows a token placeholder' do
2020-06-23 00:09:42 +05:30
token_placeholder = find_field('Token')['placeholder']
2017-08-17 22:00:37 +05:30
expect(token_placeholder).to eq('XXxxXXxxXXxxXXxxXXxxXXxx')
end
it 'shows a help message' do
2021-11-11 11:23:49 +05:30
expect(page).to have_content('Perform common operations in this project')
2017-08-17 22:00:37 +05:30
end
2020-06-23 00:09:42 +05:30
it 'redirects to the integrations page after saving but not activating' do
fill_in 'Token', with: 'token'
2020-11-24 15:15:51 +05:30
click_active_checkbox
2017-08-17 22:00:37 +05:30
click_on 'Save'
2022-05-07 20:08:51 +05:30
expect(page).to have_current_path(edit_project_integration_path(project, :slack_slash_commands), ignore_query: true)
2020-11-24 15:15:51 +05:30
expect(page).to have_content('Slack slash commands settings saved, but not active.')
2017-09-10 17:25:29 +05:30
end
2020-06-23 00:09:42 +05:30
it 'redirects to the integrations page after activating' do
fill_in 'Token', with: 'token'
2017-09-10 17:25:29 +05:30
click_on 'Save'
2017-08-17 22:00:37 +05:30
2022-05-07 20:08:51 +05:30
expect(page).to have_current_path(edit_project_integration_path(project, :slack_slash_commands), ignore_query: true)
2020-11-24 15:15:51 +05:30
expect(page).to have_content('Slack slash commands settings saved and active.')
2017-08-17 22:00:37 +05:30
end
it 'shows the correct trigger url' do
value = find_field('url').value
2017-09-10 17:25:29 +05:30
expect(value).to match("api/v4/projects/#{project.id}/services/slack_slash_commands/trigger")
2017-08-17 22:00:37 +05:30
end
2021-03-11 19:13:27 +05:30
it 'shows help content' do
2021-11-11 11:23:49 +05:30
expect(page).to have_content('Perform common operations in this project by entering slash commands in Slack.')
2021-03-11 19:13:27 +05:30
end
2017-08-17 22:00:37 +05:30
end