Skip to content

Feature request: have_enqueued_email matcher to deal with ActionMailer::DeliveryJob #1901

Closed
@fabn

Description

@fabn

I use a lot the have_enqueued_job matcher because I like its syntax and it also perform params serialization that allows me to catch invalid arguments given to background jobs such as symbol serialization.

However I think that it's a little bit too verbose when used with ActionMailer::DeliveryJob e.g.

expect {
  subject.perform request
}.to have_enqueued_job(ActionMailer::DeliveryJob).with(
    'SubscriptionMailer',
    'welcome',
    'deliver_now',
    hash_including('email_address' => email),
    'en'
)

It would be very nice to have a specialized wrapper around it, something like this

expect {
  subject.perform request
}.to have_enqueued_email(SubscriptionMailer, :welcome).with(hash_including('email_address' => email), 'en')

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions