diff --git a/test/property/test_webhook_handler.rb b/test/property/test_webhook_handler.rb index 3a30b203fb101030f5f0d5c3c65c42594b9408c2..61a4275262182f494dee2a88fdd2f3056d4b137c 100644 --- a/test/property/test_webhook_handler.rb +++ b/test/property/test_webhook_handler.rb @@ -101,4 +101,25 @@ class WebhookPropertyTest < Minitest::Test } end em :test_single_recipient_message_failed_sends_one_error + + def test_outbound_unregistered_returns_403 + property_of { + Webhook + .new(REDIS) + .registered { + false + } + .type { + choose(*Webhook::OUTBOUND_TYPES) + } + .generate + }.check { |metadata, example| + result = invoke_webhook(example) + assert_equal [403, {}, "Customer not found\n"], result + assert_empty written + entries = REDIS.stream_entries("messages").sync + assert_empty entries + } + end + em :test_outbound_unregistered_returns_403 end