diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2016-12-23 09:46:32 +0100 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2016-12-23 09:46:32 +0100 |
commit | b7894a7451b5e6802f24690162cdf1fbb3454136 (patch) | |
tree | ba6b48ca04cfe8f4a881ab77a0a14888c92bf015 /spec/lib/gitlab | |
parent | 358a2d8b0dac1ca7d82c10103d2dca4b73b412ae (diff) | |
download | gitlab-ce-b7894a7451b5e6802f24690162cdf1fbb3454136.tar.gz |
Fix errorcode 500 on slash commandszj-fix-issue-search-chat-command
Coverage was failing, so this could slip through the cracks
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r-- | spec/lib/gitlab/chat_commands/command_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/lib/gitlab/chat_commands/command_spec.rb b/spec/lib/gitlab/chat_commands/command_spec.rb index a0ec8884635..a2d84977f58 100644 --- a/spec/lib/gitlab/chat_commands/command_spec.rb +++ b/spec/lib/gitlab/chat_commands/command_spec.rb @@ -54,6 +54,30 @@ describe Gitlab::ChatCommands::Command, service: true do end end + context 'searching for an issue' do + let(:params) { { text: 'issue search find me' } } + let!(:issue) { create(:issue, project: project, title: 'find me') } + + before do + project.team << [user, :master] + end + + context 'a single issue is found' do + it 'presents the issue' do + expect(subject[:text]).to match(issue.title) + end + end + + context 'multiple issues found' do + let!(:issue2) { create(:issue, project: project, title: "someone find me") } + + it 'shows a link to the new issue' do + expect(subject[:text]).to match(issue.title) + expect(subject[:text]).to match(issue2.title) + end + end + end + context 'when trying to do deployment' do let(:params) { { text: 'deploy staging to production' } } let!(:build) { create(:ci_build, project: project) } |