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:
parent
926002a7f3
commit
ecc9473622
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue