summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/chat_commands
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2017-01-19 09:22:09 +0100
committerZ.J. van de Weg <git@zjvandeweg.nl>2017-01-30 09:25:15 +0100
commit4ce1a17c9767a80dfae0b47cee236d2a5d88918b (patch)
tree402e360833cd17da346369199d9cc1d09fe7ad35 /spec/lib/gitlab/chat_commands
parent72843e021dba0022b75f3fd3988115691c19a4fb (diff)
downloadgitlab-ce-4ce1a17c9767a80dfae0b47cee236d2a5d88918b.tar.gz
Incorporate feedback
Diffstat (limited to 'spec/lib/gitlab/chat_commands')
-rw-r--r--spec/lib/gitlab/chat_commands/issue_search_spec.rb2
-rw-r--r--spec/lib/gitlab/chat_commands/issue_show_spec.rb4
-rw-r--r--spec/lib/gitlab/chat_commands/presenters/deploy_spec.rb2
-rw-r--r--spec/lib/gitlab/chat_commands/presenters/list_issues_spec.rb5
-rw-r--r--spec/lib/gitlab/chat_commands/presenters/show_issue_spec.rb4
5 files changed, 8 insertions, 9 deletions
diff --git a/spec/lib/gitlab/chat_commands/issue_search_spec.rb b/spec/lib/gitlab/chat_commands/issue_search_spec.rb
index 04d10ad52a1..551ccb79a58 100644
--- a/spec/lib/gitlab/chat_commands/issue_search_spec.rb
+++ b/spec/lib/gitlab/chat_commands/issue_search_spec.rb
@@ -26,7 +26,7 @@ describe Gitlab::ChatCommands::IssueSearch, service: true do
it 'returns all results' do
expect(subject).to have_key(:attachments)
- expect(subject[:text]).to match("Here are the issues I found:")
+ expect(subject[:text]).to eq("Here are the 2 issues I found:")
end
end
diff --git a/spec/lib/gitlab/chat_commands/issue_show_spec.rb b/spec/lib/gitlab/chat_commands/issue_show_spec.rb
index 89932c395c6..1f20d0a44ce 100644
--- a/spec/lib/gitlab/chat_commands/issue_show_spec.rb
+++ b/spec/lib/gitlab/chat_commands/issue_show_spec.rb
@@ -20,7 +20,7 @@ describe Gitlab::ChatCommands::IssueShow, service: true do
it 'returns the issue' do
expect(subject[:response_type]).to be(:in_channel)
- expect(title).to eq(issue.title)
+ expect(title).to start_with(issue.title)
end
context 'when its reference is given' do
@@ -28,7 +28,7 @@ describe Gitlab::ChatCommands::IssueShow, service: true do
it 'shows the issue' do
expect(subject[:response_type]).to be(:in_channel)
- expect(title).to eq(issue.title)
+ expect(title).to start_with(issue.title)
end
end
end
diff --git a/spec/lib/gitlab/chat_commands/presenters/deploy_spec.rb b/spec/lib/gitlab/chat_commands/presenters/deploy_spec.rb
index 1c48c727e30..dc2dd300072 100644
--- a/spec/lib/gitlab/chat_commands/presenters/deploy_spec.rb
+++ b/spec/lib/gitlab/chat_commands/presenters/deploy_spec.rb
@@ -32,7 +32,7 @@ describe Gitlab::ChatCommands::Presenters::Deploy do
end
describe '#too_many_actions' do
- subject { described_class.new(nil).too_many_actions }
+ subject { described_class.new([]).too_many_actions }
it { is_expected.to have_key(:text) }
it { is_expected.to have_key(:response_type) }
diff --git a/spec/lib/gitlab/chat_commands/presenters/list_issues_spec.rb b/spec/lib/gitlab/chat_commands/presenters/list_issues_spec.rb
index 1852395fc97..13a1f70fe78 100644
--- a/spec/lib/gitlab/chat_commands/presenters/list_issues_spec.rb
+++ b/spec/lib/gitlab/chat_commands/presenters/list_issues_spec.rb
@@ -3,13 +3,12 @@ require 'spec_helper'
describe Gitlab::ChatCommands::Presenters::ListIssues do
let(:project) { create(:empty_project) }
let(:message) { subject[:text] }
- let(:issue) { project.issues.first }
before { create_list(:issue, 2, project: project) }
subject { described_class.new(project.issues).present }
- it do
+ it 'formats the message correct' do
is_expected.to have_key(:text)
is_expected.to have_key(:status)
is_expected.to have_key(:response_type)
@@ -19,6 +18,6 @@ describe Gitlab::ChatCommands::Presenters::ListIssues do
it 'shows a list of results' do
expect(subject[:response_type]).to be(:ephemeral)
- expect(message).to start_with("Here are the issues I found")
+ expect(message).to start_with("Here are the 2 issues I found")
end
end
diff --git a/spec/lib/gitlab/chat_commands/presenters/show_issue_spec.rb b/spec/lib/gitlab/chat_commands/presenters/show_issue_spec.rb
index 13a318fe680..ca4062e692a 100644
--- a/spec/lib/gitlab/chat_commands/presenters/show_issue_spec.rb
+++ b/spec/lib/gitlab/chat_commands/presenters/show_issue_spec.rb
@@ -12,7 +12,7 @@ describe Gitlab::ChatCommands::Presenters::ShowIssue do
it 'shows the issue' do
expect(subject[:response_type]).to be(:in_channel)
expect(subject).to have_key(:attachments)
- expect(attachment[:title]).to eq(issue.title)
+ expect(attachment[:title]).to start_with(issue.title)
end
context 'with upvotes' do
@@ -21,7 +21,7 @@ describe Gitlab::ChatCommands::Presenters::ShowIssue do
end
it 'shows the upvote count' do
- expect(attachment[:text]).to start_with(":+1: 1")
+ expect(attachment[:text]).to start_with("**Open** ยท :+1: 1")
end
end
end