summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2016-12-13 16:53:01 +0000
committerKamil Trzcinski <ayufan@ayufan.eu>2016-12-18 23:24:57 +0100
commit3f60a276fc36fc7d1c5323c38b33fdbc774cfbbf (patch)
treeaa5aa6486a8477035dfd63ce64ca15dae4312340 /spec
parent0f2776287a7d9b0fde9ff54ef8d9f74e2f844a09 (diff)
downloadgitlab-ce-3f60a276fc36fc7d1c5323c38b33fdbc774cfbbf.tar.gz
Added slack slash commands frontend help well
Added tests
Diffstat (limited to 'spec')
-rw-r--r--spec/features/projects/services/slack_slash_command_spec.rb48
1 files changed, 48 insertions, 0 deletions
diff --git a/spec/features/projects/services/slack_slash_command_spec.rb b/spec/features/projects/services/slack_slash_command_spec.rb
new file mode 100644
index 00000000000..dee43d69895
--- /dev/null
+++ b/spec/features/projects/services/slack_slash_command_spec.rb
@@ -0,0 +1,48 @@
+require 'spec_helper'
+
+feature 'Setup Slack slash commands', feature: true do
+ include WaitForAjax
+
+ let(:user) { create(:user) }
+ let(:project) { create(:project) }
+ let(:service) { project.create_slack_slash_commands_service }
+
+ before do
+ project.team << [user, :master]
+ login_as(user)
+ end
+
+ describe 'user visits the slack slash command config page', js: true do
+ it 'shows a help message' do
+ visit edit_namespace_project_service_path(project.namespace, project, service)
+
+ wait_for_ajax
+
+ expect(page).to have_content('This service allows GitLab users to perform common')
+ end
+ end
+
+ describe 'saving a token' do
+ let(:token) { ('a'..'z').to_a.join }
+
+ it 'shows the token after saving' do
+ visit edit_namespace_project_service_path(project.namespace, project, service)
+
+ fill_in 'service_token', with: token
+ click_on 'Save'
+
+ value = find_field('service_token').value
+
+ expect(value).to eq(token)
+ end
+ end
+
+ describe 'the trigger url' do
+ it 'shows the correct url' do
+ visit edit_namespace_project_service_path(project.namespace, project, service)
+
+ value = find_field('url').value
+ expect(value).to match("api/v3/projects/#{project.id}/services/slack_slash_commands/trigger")
+ end
+ end
+end