Merge pull request #306 from namespaceMarcello/post-webhook-attachments-only-on-success

Post a webhook reply as an attachment only when the bot answered 200
This commit is contained in:
Stanko Krtalić
2026-10-05 17:13:57 +02:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ class WebhookTest < ActiveSupport::TestCase
test "delivery with error reply" do
assert_no_difference -> { Message.count } do
WebMock.stub_request(:post, webhooks(:bender).url).to_return(status: 500, body: "Internal Error!", headers: {})
WebMock.stub_request(:post, webhooks(:bender).url).to_return(status: 500, body: "<h1>Internal Error!</h1>", headers: { "Content-Type" => "text/html" })
response = webhooks(:bender).deliver(messages(:first))
end
end