Skip to content
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

add support for recognizing mailer many jobs: #2125

Merged
merged 1 commit into from May 16, 2019

Conversation

ignatiusreza
Copy link
Contributor

  • parameterized mailer when RAILS_VERSION >= 5.1
  • unified mailer job when RAILS_VERSION >= 6.0

per #2117 (comment)

this PR supersede #2121 with added support for recognizing ActionMailer::MailDeliveryJob freshly added into rails 6.0

@ignatiusreza
Copy link
Contributor Author

got lucky with rubocop new release, which break CI.. opened #2126 to fix CI.. will rebased this branch after CI is fixed..

@benoittgt
Copy link
Member

this PR supersede #2121

Can we close is then?

lib/rspec/rails/matchers/active_job.rb Show resolved Hide resolved
@@ -63,20 +68,18 @@ def expected_count_message
"#{message_expectation_modifier} #{@expected_number} #{@expected_number == 1 ? 'time' : 'times'}"
end

def mailer_args
def job_match?(job)
MAILER_JOBS.any? { |mailer_job| send(mailer_job, job) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd rather we just called legacy_mail?(mailer_job, job) || parameterized_mail?(mailer_job, job) || unified_mail?(mailer_job, job) rather than constantising it and iterating.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, updated.. I used constant because I thought it would be easier later IF we somehow need to add check for other job..

- parameterized mailer when RAILS_VERSION >= 5.1
- unified mailer job when RAILS_VERSION >= 6.0
@benoittgt
Copy link
Member

@samphippen are you ok to merge this? 😊

@JonRowe JonRowe merged commit 2a95ded into rspec:4-0-dev May 16, 2019
@ignatiusreza ignatiusreza deleted the mailer-job branch May 16, 2019 15:43
JonRowe added a commit that referenced this pull request May 17, 2019
benoittgt added a commit that referenced this pull request May 18, 2019
benoittgt pushed a commit that referenced this pull request Aug 21, 2019
benoittgt added a commit that referenced this pull request Aug 21, 2019
benoittgt pushed a commit to benoittgt/rspec-rails that referenced this pull request Aug 24, 2019
benoittgt added a commit to benoittgt/rspec-rails that referenced this pull request Aug 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants