Change summary
test/property/test_webhook_handler.rb | 13 +++++++++++++
1 file changed, 13 insertions(+)
Detailed changes
@@ -438,4 +438,17 @@ class WebhookPropertyTest < Minitest::Test
}
end
em :test_request_with_non_post_method_produces_no_output
+
+ def test_payload_without_message_or_type_returns_400
+ property_of {
+ metadata, example = Webhook.new(REDIS).generate
+ [choose("message", "type"), metadata, example]
+ }.check { |key, metadata, example|
+ example.delete(key)
+ result = invoke_webhook(example)
+ assert_equal [400, {}, "Missing params\n"], result
+ assert_empty written
+ }
+ end
+ em :test_payload_without_message_or_type_returns_400
end