Skip to content

Commit

Permalink
Merge pull request #977 from uurcankaya/master
Browse files Browse the repository at this point in the history
fix: Webhook controller returns 204 instead of 200
  • Loading branch information
Tim Anema authored Apr 28, 2020
2 parents 845c009 + 925afe6 commit 73cbb20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/shopify_app/webhooks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/integration/webhooks_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 73cbb20

Please sign in to comment.