1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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
This commit is contained in:
Ronak Jangir 2015-09-22 19:11:03 +05:30
parent 926002a7f3
commit ecc9473622

View file

@ -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