summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLuke Duncalfe <lduncalfe@eml.cc>2019-03-28 16:59:17 +1300
committerLuke Duncalfe <lduncalfe@eml.cc>2019-03-28 16:59:17 +1300
commitdfb1dac6994bc8ea1d37d35155d41af268ea0239 (patch)
tree1682084b2164b9e81f4b52c0153d0ba8b5d9b521 /spec
parent8f8c51561dd28e0c6833eac775564cd65c4ded0d (diff)
downloadgitlab-shell-dfb1dac6994bc8ea1d37d35155d41af268ea0239.tar.gz
Allow GitlabPostReceive to print warnings
Warnings are printed using the same method that prints broadcast messages. This ensures that whatever warnings are returned will be displayed correctly.
Diffstat (limited to 'spec')
-rw-r--r--spec/gitlab_post_receive_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/gitlab_post_receive_spec.rb b/spec/gitlab_post_receive_spec.rb
index 3cae631..27715db 100644
--- a/spec/gitlab_post_receive_spec.rb
+++ b/spec/gitlab_post_receive_spec.rb
@@ -96,7 +96,21 @@ describe GitlabPostReceive do
expect(gitlab_post_receive.exec).to eq(true)
end
end
+ end
+
+ context 'when warnings available' do
+ let(:response) do
+ {
+ 'reference_counter_decreased' => true,
+ 'warnings' => 'My warning message'
+ }
+ end
+ it 'prints warnings the same ways as broadcast messages' do
+ expect_any_instance_of(GitlabNet).to receive(:post_receive).and_return(response)
+ expect(gitlab_post_receive).to receive(:print_broadcast_message).with("WARNINGS:\nMy warning message")
+ expect(gitlab_post_receive.exec).to eq(true)
+ end
end
context 'when redirected message available' do