-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Improve mailer argument deserialisation for 6.1 on Ruby 3.1 #2566
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -399,16 +399,18 @@ def self.name; "NonMailerJob"; end | |
}.to have_enqueued_mail(UnifiedMailer, :email_with_args).with(1, 2) | ||
end | ||
|
||
it "matches arguments when mailer is parameterized" do | ||
it "passes with provided argument matchers" do | ||
expect { | ||
UnifiedMailer.with('foo' => 'bar').test_email.deliver_later | ||
}.to have_enqueued_mail(UnifiedMailer, :test_email).with('foo' => 'bar') | ||
end | ||
}.to have_enqueued_mail(UnifiedMailer, :test_email).with( | ||
a_hash_including(params: {'foo' => 'bar'}) | ||
) | ||
|
||
it "matches arguments when mixing parameterized and non-parameterized emails" do | ||
expect { | ||
UnifiedMailer.with('foo' => 'bar').email_with_args(1, 2).deliver_later | ||
}.to have_enqueued_mail(UnifiedMailer, :email_with_args).with({'foo' => 'bar'}, 1, 2) | ||
}.to have_enqueued_mail(UnifiedMailer, :email_with_args).with( | ||
a_hash_including(params: {'foo' => 'bar'}, args: [1, 2]) | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This just unpicks the changes to the behaviour There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if both: have_enqueued_mail(UnifiedMailer, :email_with_args).with(
a_hash_including(params: {'foo' => 'bar'}, args: [1, 2])
) and have_enqueued_mail(UnifiedMailer, :email_with_args).with({'foo' => 'bar'}, 1, 2) would match. |
||
end | ||
|
||
it "passes when using a mailer with `delivery_job` set to a sub class of `ActionMailer::DeliveryJob`" do | ||
|
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.
If we want this it should be in RSpec Support, its a later improvement that could be made once 3.11 is released.