summaryrefslogtreecommitdiff
path: root/spec/services/web_hook_service_spec.rb
diff options
context:
space:
mode:
authorAlexander Randa <randa.alex@gmail.com>2017-07-20 15:12:06 +0000
committerRémy Coutable <remy@rymai.me>2017-07-20 15:12:06 +0000
commite0ab5618a0998175df9f90c95ebd35d7afa01db7 (patch)
tree91cfff5c3c9f6a118d69df5e2816b7461ce2ccc5 /spec/services/web_hook_service_spec.rb
parent020b6a0be06614815d96854084f3dcafeefcf0b7 (diff)
downloadgitlab-ce-e0ab5618a0998175df9f90c95ebd35d7afa01db7.tar.gz
Wrong data type when testing webhooks
Diffstat (limited to 'spec/services/web_hook_service_spec.rb')
-rw-r--r--spec/services/web_hook_service_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/services/web_hook_service_spec.rb b/spec/services/web_hook_service_spec.rb
index b5abc46e80c..7ff37c22963 100644
--- a/spec/services/web_hook_service_spec.rb
+++ b/spec/services/web_hook_service_spec.rb
@@ -58,7 +58,7 @@ describe WebHookService, services: true do
exception = exception_class.new('Exception message')
WebMock.stub_request(:post, project_hook.url).to_raise(exception)
- expect(service_instance.execute).to eq([nil, exception.message])
+ expect(service_instance.execute).to eq({ status: :error, message: exception.message })
expect { service_instance.execute }.not_to raise_error
end
end
@@ -66,13 +66,13 @@ describe WebHookService, services: true do
it 'handles 200 status code' do
WebMock.stub_request(:post, project_hook.url).to_return(status: 200, body: 'Success')
- expect(service_instance.execute).to eq([200, 'Success'])
+ expect(service_instance.execute).to include({ status: :success, http_status: 200, message: 'Success' })
end
it 'handles 2xx status codes' do
WebMock.stub_request(:post, project_hook.url).to_return(status: 201, body: 'Success')
- expect(service_instance.execute).to eq([201, 'Success'])
+ expect(service_instance.execute).to include({ status: :success, http_status: 201, message: 'Success' })
end
context 'execution logging' do