From d90c4552e8d68e4518bfd7168877ad2988374362 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Fri, 24 May 2019 11:17:41 +1000 Subject: [PATCH] feat(webhooks): return a 200 status for webhook test execution response even when execution has failed --- lib/pact_broker/api/resources/webhook_execution.rb | 7 +------ .../pact_broker/api/resources/webhook_execution_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/pact_broker/api/resources/webhook_execution.rb b/lib/pact_broker/api/resources/webhook_execution.rb index 07a7d3e49..d7ce1a642 100644 --- a/lib/pact_broker/api/resources/webhook_execution.rb +++ b/lib/pact_broker/api/resources/webhook_execution.rb @@ -16,12 +16,7 @@ def process_post webhook_execution_result = webhook_service.test_execution(webhook, webhook_options) response.headers['Content-Type'] = 'application/hal+json;charset=utf-8' response.body = post_response_body webhook_execution_result - if webhook_execution_result.success? - true - else - response.headers[PactBroker::DO_NOT_ROLLBACK] = 'true' - 500 - end + true end def resource_exists? diff --git a/spec/lib/pact_broker/api/resources/webhook_execution_spec.rb b/spec/lib/pact_broker/api/resources/webhook_execution_spec.rb index 039274a96..9709d12c1 100644 --- a/spec/lib/pact_broker/api/resources/webhook_execution_spec.rb +++ b/spec/lib/pact_broker/api/resources/webhook_execution_spec.rb @@ -75,9 +75,9 @@ module Resources context "when execution is not successful" do let(:success) { false } - it "returns a 500 JSON response" do + it "returns a 200 JSON response" do subject - expect(last_response.status).to eq 500 + expect(last_response.status).to eq 200 end it "includes the execution result JSON in the body" do