-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove redundant test from message_delivery_test
#47893
Remove redundant test from message_delivery_test
#47893
Conversation
You can argue it's a cosmetic change, but I do see the value in consistency! 🤔 |
test "should enqueue and run correctly in activejob" do | ||
@mail.deliver_later! | ||
assert_equal 1, ActionMailer::Base.deliveries.size | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could just remove this test instead. It looks like the described behavior is thoroughly covered by the next two tests, right?
rails/actionmailer/test/message_delivery_test.rb
Lines 65 to 75 in ef04fbb
test "should enqueue the email with :deliver_now delivery method" do | |
assert_performed_with(job: ActionMailer::MailDeliveryJob, args: ["DelayedMailer", "test_message", "deliver_now", args: [1, 2, 3]]) do | |
@mail.deliver_later | |
end | |
end | |
test "should enqueue the email with :deliver_now! delivery method" do | |
assert_performed_with(job: ActionMailer::MailDeliveryJob, args: ["DelayedMailer", "test_message", "deliver_now!", args: [1, 2, 3]]) do | |
@mail.deliver_later! | |
end | |
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonathanhefner Yes, that makes sense. I can do it. Do you want me to raise another PR for this or should I change the title of this one?
dc8b476
to
f30fc95
Compare
message_delivery_test
use test macro to make the test definitions uniformmessage_delivery_test
Thank you, @shivamsinghchahar! ✂️ |
Using test macro instead of regular method definition to make the tests uniform.