diff options
author | Ronak Jangir <ronakjangir47@gmail.com> | 2015-09-22 19:11:03 +0530 |
---|---|---|
committer | Ronak Jangir <ronakjangir47@gmail.com> | 2015-09-22 19:11:03 +0530 |
commit | ecc94736223e2308958a18aefb80e79ec5111d76 (patch) | |
tree | d8e67d85f1ee4ab3606869539d859e50b3bf43f6 /actionmailer | |
parent | 926002a7f39ef185f4a9f9ec1264204230f895ab (diff) | |
download | rails-ecc94736223e2308958a18aefb80e79ec5111d76.tar.gz rails-ecc94736223e2308958a18aefb80e79ec5111d76.tar.bz2 rails-ecc94736223e2308958a18aefb80e79ec5111d76.zip |
Added assertion for error messages for nil and unknown delivery methods
As `deliver_now` `RuntimeError` for both nil & unknown delivery method so it’s good to have assertion for error messages
Diffstat (limited to 'actionmailer')
-rw-r--r-- | actionmailer/test/delivery_methods_test.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/actionmailer/test/delivery_methods_test.rb b/actionmailer/test/delivery_methods_test.rb index ceaa4ca83e..d17e774092 100644 --- a/actionmailer/test/delivery_methods_test.rb +++ b/actionmailer/test/delivery_methods_test.rb @@ -165,16 +165,18 @@ class MailDeliveryTest < ActiveSupport::TestCase test "non registered delivery methods raises errors" do DeliveryMailer.delivery_method = :unknown - assert_raise RuntimeError do + error = assert_raise RuntimeError do DeliveryMailer.welcome.deliver_now end + assert_equal "Invalid delivery method :unknown", error.message end test "undefined delivery methods raises errors" do DeliveryMailer.delivery_method = nil - assert_raise RuntimeError do + error = assert_raise RuntimeError do DeliveryMailer.welcome.deliver_now end + assert_equal "Delivery method cannot be nil", error.message end test "does not perform deliveries if requested" do |