summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-11-21 19:40:04 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-11-21 21:36:22 +0100
commit41aa605d4ed3d0d302c70ecd01052115f818f949 (patch)
tree392a694c913591493ed2de4de5c46acaf5222082 /spec/lib
parentd375e3f15b6f0340addb9a20e0c03a1f1fca413a (diff)
downloadgitlab-ce-41aa605d4ed3d0d302c70ecd01052115f818f949.tar.gz
Improve deploy command message
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/chat_commands/command_spec.rb2
-rw-r--r--spec/lib/gitlab/chat_commands/deploy_spec.rb13
2 files changed, 9 insertions, 6 deletions
diff --git a/spec/lib/gitlab/chat_commands/command_spec.rb b/spec/lib/gitlab/chat_commands/command_spec.rb
index 924b4b7b101..bfc6818ac08 100644
--- a/spec/lib/gitlab/chat_commands/command_spec.rb
+++ b/spec/lib/gitlab/chat_commands/command_spec.rb
@@ -74,7 +74,7 @@ describe Gitlab::ChatCommands::Command, service: true do
end
it 'returns action' do
- expect(subject[:text]).to include(manual.name)
+ expect(subject[:text]).to include('Deployment from staging to production started')
expect(subject[:response_type]).to be(:in_channel)
end
diff --git a/spec/lib/gitlab/chat_commands/deploy_spec.rb b/spec/lib/gitlab/chat_commands/deploy_spec.rb
index 26741367e63..bd8099c92da 100644
--- a/spec/lib/gitlab/chat_commands/deploy_spec.rb
+++ b/spec/lib/gitlab/chat_commands/deploy_spec.rb
@@ -36,8 +36,9 @@ describe Gitlab::ChatCommands::Deploy, service: true do
create(:ci_build, :manual, project: project, pipeline: build.pipeline, name: 'first', environment: 'production')
end
- it 'returns action' do
- expect(subject).to eq(manual1)
+ it 'returns success result' do
+ expect(subject.type).to eq(:success)
+ expect(subject.message).to include('Deployment from staging to production started')
end
context 'when duplicate action exists' do
@@ -46,7 +47,8 @@ describe Gitlab::ChatCommands::Deploy, service: true do
end
it 'returns error' do
- expect(subject.message).to eq('Too many actions defined')
+ expect(subject.type).to eq(:error)
+ expect(subject.message).to include('Too many actions defined')
end
end
@@ -57,8 +59,9 @@ describe Gitlab::ChatCommands::Deploy, service: true do
name: 'teardown', environment: 'production')
end
- it 'returns error' do
- expect(subject).to eq(manual1)
+ it 'returns success result' do
+ expect(subject.type).to eq(:success)
+ expect(subject.message).to include('Deployment from staging to production started')
end
end
end