diff options
author | Nick Thomas <nick@gitlab.com> | 2019-09-01 12:42:22 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-09-01 12:42:22 +0000 |
commit | a8a10a00388667ca24ef09a7555f86e40ae52dfa (patch) | |
tree | 6aaf266275eb7ceae23a40ffb9da9f9da8287dea /spec/lib | |
parent | bff1b4f0d7f862d96b025f4d18085b46904a251c (diff) | |
parent | e8dd299e7cb4fbb622359d762089367267ed5c09 (diff) | |
download | gitlab-ce-a8a10a00388667ca24ef09a7555f86e40ae52dfa.tar.gz |
Merge branch 'improve-chatops-help' into 'master'
Improve chatops help output
See merge request gitlab-org/gitlab-ce!32208
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/slash_commands/application_help_spec.rb | 3 | ||||
-rw-r--r-- | spec/lib/gitlab/slash_commands/command_spec.rb | 6 | ||||
-rw-r--r-- | spec/lib/gitlab/slash_commands/presenters/access_spec.rb | 6 |
3 files changed, 9 insertions, 6 deletions
diff --git a/spec/lib/gitlab/slash_commands/application_help_spec.rb b/spec/lib/gitlab/slash_commands/application_help_spec.rb index b203a1ee79c..afa63c21584 100644 --- a/spec/lib/gitlab/slash_commands/application_help_spec.rb +++ b/spec/lib/gitlab/slash_commands/application_help_spec.rb @@ -4,10 +4,11 @@ require 'spec_helper' describe Gitlab::SlashCommands::ApplicationHelp do let(:params) { { command: '/gitlab', text: 'help' } } + let(:project) { build(:project) } describe '#execute' do subject do - described_class.new(params).execute + described_class.new(project, params).execute end it 'displays the help section' do diff --git a/spec/lib/gitlab/slash_commands/command_spec.rb b/spec/lib/gitlab/slash_commands/command_spec.rb index c4ea8cbf2b1..dc412c80e68 100644 --- a/spec/lib/gitlab/slash_commands/command_spec.rb +++ b/spec/lib/gitlab/slash_commands/command_spec.rb @@ -27,7 +27,7 @@ describe Gitlab::SlashCommands::Command do it 'displays the help message' do expect(subject[:response_type]).to be(:ephemeral) - expect(subject[:text]).to start_with('Unknown command') + expect(subject[:text]).to start_with('The specified command is not valid') expect(subject[:text]).to match('/gitlab issue show') end end @@ -37,7 +37,7 @@ describe Gitlab::SlashCommands::Command do it 'rejects the actions' do expect(subject[:response_type]).to be(:ephemeral) - expect(subject[:text]).to start_with('Whoops! This action is not allowed') + expect(subject[:text]).to start_with('You are not allowed') end end @@ -57,7 +57,7 @@ describe Gitlab::SlashCommands::Command do context 'and user can not create deployment' do it 'returns action' do expect(subject[:response_type]).to be(:ephemeral) - expect(subject[:text]).to start_with('Whoops! This action is not allowed') + expect(subject[:text]).to start_with('You are not allowed') end end diff --git a/spec/lib/gitlab/slash_commands/presenters/access_spec.rb b/spec/lib/gitlab/slash_commands/presenters/access_spec.rb index 286fec892e6..f00039c634f 100644 --- a/spec/lib/gitlab/slash_commands/presenters/access_spec.rb +++ b/spec/lib/gitlab/slash_commands/presenters/access_spec.rb @@ -4,12 +4,14 @@ require 'spec_helper' describe Gitlab::SlashCommands::Presenters::Access do describe '#access_denied' do - subject { described_class.new.access_denied } + let(:project) { build(:project) } + + subject { described_class.new.access_denied(project) } it { is_expected.to be_a(Hash) } it 'displays an error message' do - expect(subject[:text]).to match("is not allowed") + expect(subject[:text]).to match('are not allowed') expect(subject[:response_type]).to be(:ephemeral) end end |