diff options
author | Fatih Acet <acetfatih@gmail.com> | 2016-11-22 16:06:31 +0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-11-22 18:43:33 +0300 |
commit | 7d7c44515051836ad255b0813a27de1ab8000905 (patch) | |
tree | 69701e8356a28112db7518841849142944368e5f /spec | |
parent | 9f372fc136d95fc0f61926a66ff5f6163e9507e3 (diff) |
Merge branch 'zj-mattermost-command-help-message' into 'master'
Add help section for MM commands
## What should this MR do
Check @pedroms' design for the Mattermost service screen: https://gitlab.com/gitlab-org/gitlab-ce/issues/22540
Now this has to be implemented, I've created a clean canvas for you, @lbennett, to draw on.
## Does this MR meet the acceptance criteria?
- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added
- Tests
- [x] Added for this feature/bug
- [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
See merge request !7558
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/projects/services/mattermost_slash_command_spec.rb | 48 | ||||
-rw-r--r-- | spec/features/projects/services/slack_service_spec.rb (renamed from spec/features/projects/slack_service/slack_service_spec.rb) | 0 |
2 files changed, 48 insertions, 0 deletions
diff --git a/spec/features/projects/services/mattermost_slash_command_spec.rb b/spec/features/projects/services/mattermost_slash_command_spec.rb new file mode 100644 index 00000000000..f474e7e891b --- /dev/null +++ b/spec/features/projects/services/mattermost_slash_command_spec.rb @@ -0,0 +1,48 @@ +require 'spec_helper' + +feature 'Setup Mattermost slash commands', feature: true do + include WaitForAjax + + let(:user) { create(:user) } + let(:project) { create(:project) } + let(:service) { project.create_mattermost_slash_commands_service } + + before do + project.team << [user, :master] + login_as(user) + end + + describe 'user visites the mattermost 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('request_url').value + expect(value).to match("api/v3/projects/#{project.id}/services/mattermost_slash_commands/trigger") + end + end +end diff --git a/spec/features/projects/slack_service/slack_service_spec.rb b/spec/features/projects/services/slack_service_spec.rb index 16541f51d98..16541f51d98 100644 --- a/spec/features/projects/slack_service/slack_service_spec.rb +++ b/spec/features/projects/services/slack_service_spec.rb |