summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-07-14 06:37:00 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-07-14 06:37:00 +0000
commit6f81fc44a909f7ae95d322e729eb95e9e066e85a (patch)
treec3584e0f9573cb2d0413d7db21f8b29eb3a2d3af /spec/requests
parentdbcc0e03ac82d6b90fc93b1fefac8ce80c741178 (diff)
parente6cd2353a4123af3183188b200233a32ea7adbdd (diff)
downloadgitlab-ce-6f81fc44a909f7ae95d322e729eb95e9e066e85a.tar.gz
Merge branch 'sh-fix-nil-broadcast-message' into 'master'
Handle case when BroadcastMessage.current is nil Closes #35094 See merge request !12860
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/internal_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/requests/api/internal_spec.rb b/spec/requests/api/internal_spec.rb
index 453eb4683a0..beaaf346283 100644
--- a/spec/requests/api/internal_spec.rb
+++ b/spec/requests/api/internal_spec.rb
@@ -35,6 +35,17 @@ describe API::Internal do
expect(json_response).to be_empty
end
end
+
+ context 'nil broadcast message' do
+ it 'returns nothing' do
+ allow(BroadcastMessage).to receive(:current).and_return(nil)
+
+ get api('/internal/broadcast_message'), secret_token: secret_token
+
+ expect(response).to have_http_status(200)
+ expect(json_response).to be_empty
+ end
+ end
end
describe 'GET /internal/broadcast_messages' do