From ecc94736223e2308958a18aefb80e79ec5111d76 Mon Sep 17 00:00:00 2001 From: Ronak Jangir Date: Tue, 22 Sep 2015 19:11:03 +0530 Subject: Added assertion for error messages for nil and unknown delivery methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As `deliver_now` `RuntimeError` for both nil & unknown delivery method so it’s good to have assertion for error messages --- actionmailer/test/delivery_methods_test.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'actionmailer') 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 -- cgit v1.2.3