diff options
author | George Claghorn <george@basecamp.com> | 2018-12-03 22:15:13 -0500 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2018-12-03 22:15:13 -0500 |
commit | b404d4e0b4601e4f084fde878ec0c285615fb039 (patch) | |
tree | a620ec15374e72c714ee63ebd279bcad8e2f4980 | |
parent | b8f2835762dc064b44da1ef552140ad610bf6afa (diff) | |
download | rails-b404d4e0b4601e4f084fde878ec0c285615fb039.tar.gz rails-b404d4e0b4601e4f084fde878ec0c285615fb039.tar.bz2 rails-b404d4e0b4601e4f084fde878ec0c285615fb039.zip |
Test unsuccessfully relaying due to a client-side timeout
-rw-r--r-- | test/unit/postfix_relayer_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unit/postfix_relayer_test.rb b/test/unit/postfix_relayer_test.rb index f11ffb0518..550ed2ac7f 100644 --- a/test/unit/postfix_relayer_test.rb +++ b/test/unit/postfix_relayer_test.rb @@ -69,6 +69,15 @@ module ActionMailbox assert result.failure? end + test "unsuccessfully relaying due to client-side timeout" do + stub_request(:post, URL).to_timeout + + result = @relayer.relay(file_fixture("welcome.eml").read) + assert_equal "4.4.2 Timed out relaying to Postfix ingress", result.output + assert_not result.success? + assert result.failure? + end + test "unsuccessfully relaying due to an unhandled exception" do stub_request(:post, URL).to_raise StandardError.new("Something went wrong") |