summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorJohn T Skarbek <jskarbek@gitlab.com>2019-08-14 14:11:04 -0400
committerJohn T Skarbek <jskarbek@gitlab.com>2019-08-14 14:11:04 -0400
commit2b2efbc609a85093238ee3bec94358670021d0e5 (patch)
tree671ff737363c10b61e4a970e1c108319cc07e37d /spec/support
parentaffa81eb79ec0ca01a1a0c2733cc5cdffb3b9ff1 (diff)
parent7b52cff4896c8f681aea34fb273209400cf3e06e (diff)
downloadgitlab-ce-2b2efbc609a85093238ee3bec94358670021d0e5.tar.gz
Merge remote-tracking branch 'dev/security-2873-restrict-slash-commands-to-users-who-can-log-in'
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/shared_examples/chat_slash_commands_shared_examples.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/support/shared_examples/chat_slash_commands_shared_examples.rb b/spec/support/shared_examples/chat_slash_commands_shared_examples.rb
index 82975027e5b..dcc92dda950 100644
--- a/spec/support/shared_examples/chat_slash_commands_shared_examples.rb
+++ b/spec/support/shared_examples/chat_slash_commands_shared_examples.rb
@@ -93,6 +93,19 @@ RSpec.shared_examples 'chat slash commands service' do
subject.trigger(params)
end
+
+ context 'when user is blocked' do
+ before do
+ chat_name.user.block
+ end
+
+ it 'blocks command execution' do
+ expect_any_instance_of(Gitlab::SlashCommands::Command).not_to receive(:execute)
+
+ result = subject.trigger(params)
+ expect(result).to include(text: /^Whoops! This action is not allowed/)
+ end
+ end
end
end
end