Skip to content

have_enqueued_mail with options doesn't match #2351

@mico

Description

@mico

Because of rails/rails@f5050d9
have_enqueued_mail with options is broken
for example, we have a Mailer service:

class MailerTestService
  def save
    MailtestMailer.mailtest(option: { foo: 'bar' }).deliver_later
  end
end

and test

RSpec.describe MailerTestService, type: :service do
  it do
    expect { described_class.new.save }
      .to have_enqueued_mail(MailtestMailer, :mailtest)
      .with(option: { foo: 'bar' })
  end
end

it will not match because arguments serialization in rails/rails@f5050d9#diff-e264d3f0104c3e213b6402459897ee61R144 updated, but not updated yet in rspec-rails

Already working on a solution, will push PR soon.

related #2184

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions