From 9b0fb4f9006c5894d7f18d88a149841893cda615 Mon Sep 17 00:00:00 2001 From: Ugurcan Kaya Date: Sun, 26 Apr 2020 19:33:06 -0500 Subject: [PATCH 1/3] fix: Webhook controller returns 204 instead of 200 --- app/controllers/shopify_app/webhooks_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shopify_app/webhooks_controller.rb b/app/controllers/shopify_app/webhooks_controller.rb index 0bcddd4ad..55446fac4 100644 --- a/app/controllers/shopify_app/webhooks_controller.rb +++ b/app/controllers/shopify_app/webhooks_controller.rb @@ -9,7 +9,7 @@ def receive params.permit! job_args = { shop_domain: shop_domain, webhook: webhook_params.to_h } webhook_job_klass.perform_later(job_args) - head(:no_content) + head(:ok) end private From c26faccef907bec2ad743708e3337a700064eb62 Mon Sep 17 00:00:00 2001 From: Ugurcan Kaya Date: Mon, 27 Apr 2020 16:20:04 -0500 Subject: [PATCH 2/3] Update webhook controller tests --- test/integration/webhooks_controller_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/webhooks_controller_test.rb b/test/integration/webhooks_controller_test.rb index b4266fe11..bfcffd561 100644 --- a/test/integration/webhooks_controller_test.rb +++ b/test/integration/webhooks_controller_test.rb @@ -27,7 +27,7 @@ class WebhooksControllerTest < ActionDispatch::IntegrationTest OrderUpdateJob.expects(:perform_later).with(job_args) send_webhook 'order_update', webhook - assert_response :no_content + assert_response :ok end test "returns error for webhook with no job class" do From 925afe6e774f1b2c66b52d4ea53dc05c547c0af9 Mon Sep 17 00:00:00 2001 From: Ugurcan Kaya Date: Mon, 27 Apr 2020 16:20:36 -0500 Subject: [PATCH 3/3] Update webhook controller tests --- test/integration/webhooks_controller_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/webhooks_controller_test.rb b/test/integration/webhooks_controller_test.rb index bfcffd561..c6c1f97f3 100644 --- a/test/integration/webhooks_controller_test.rb +++ b/test/integration/webhooks_controller_test.rb @@ -16,7 +16,7 @@ class WebhooksControllerTest < ActionDispatch::IntegrationTest test "receives webhook and performs job" do send_webhook 'order_update', { foo: :bar } - assert_response :no_content + assert_response :ok assert_enqueued_jobs 1 end