diff --git a/test/property/test_webhook_handler.rb b/test/property/test_webhook_handler.rb index 5d99eaf9cf468c6adb08c57b41fab2c2e0eb8382..828086e0b6305d1014f3acc8277c545b28dbde92 100644 --- a/test/property/test_webhook_handler.rb +++ b/test/property/test_webhook_handler.rb @@ -162,4 +162,23 @@ class WebhookPropertyTest < Minitest::Test } end em :test_unknown_direction_returns_400_ok_except_when_message_failed + + def test_unknown_direction_returns_400_missing_params_when_message_failed + property_of { + Webhook + .new(REDIS) + .direction { "unknown" } + .type { + "message-failed" + } + .generate + }.check { |metadata, example| + result = invoke_webhook(example) + assert_equal [400, {}, "Missing params\n"], result + assert_empty written + entries = REDIS.stream_entries("messages").sync + assert_empty entries + } + end + em :test_unknown_direction_returns_400_missing_params_when_message_failed end