summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/slash_commands/command_spec.rb
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2018-02-22 18:34:04 +0100
committerYorick Peterse <yorickpeterse@gmail.com>2018-02-23 14:37:53 +0100
commit57719d34d3fcc15f39354b0e9dc1da41bbe5d1a8 (patch)
tree255d9a3df371793748c64792a715102dca98512c /spec/lib/gitlab/slash_commands/command_spec.rb
parentc679fa163148601e77803f45cf5dea8e1b3feb0a (diff)
downloadgitlab-ce-57719d34d3fcc15f39354b0e9dc1da41bbe5d1a8.tar.gz
Expose ChatName objects to slash commandsslash-commands-changes-for-chatops
Instead of only exposing a User to slash commands we now also expose the ChatName object that the User object is retrieved from. This is necessary for GitLab Chatops as we need for example the user ID of the chat user.
Diffstat (limited to 'spec/lib/gitlab/slash_commands/command_spec.rb')
-rw-r--r--spec/lib/gitlab/slash_commands/command_spec.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/lib/gitlab/slash_commands/command_spec.rb b/spec/lib/gitlab/slash_commands/command_spec.rb
index 0173a45d480..e3447d974aa 100644
--- a/spec/lib/gitlab/slash_commands/command_spec.rb
+++ b/spec/lib/gitlab/slash_commands/command_spec.rb
@@ -3,10 +3,11 @@ require 'spec_helper'
describe Gitlab::SlashCommands::Command do
let(:project) { create(:project) }
let(:user) { create(:user) }
+ let(:chat_name) { double(:chat_name, user: user) }
describe '#execute' do
subject do
- described_class.new(project, user, params).execute
+ described_class.new(project, chat_name, params).execute
end
context 'when no command is available' do
@@ -88,7 +89,7 @@ describe Gitlab::SlashCommands::Command do
end
describe '#match_command' do
- subject { described_class.new(project, user, params).match_command.first }
+ subject { described_class.new(project, chat_name, params).match_command.first }
context 'IssueShow is triggered' do
let(:params) { { text: 'issue show 123' } }