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 a way to check for subset of arguments when performing jobs: #33995

Merged
merged 1 commit into from
Sep 27, 2018

Conversation

Edouard-chin
Copy link
Member

  • When calling assert_performed_with/assert_enqueued_with, the
    +args+ needs to match exactly what the job get passed.

    Some jobs can have lot of arguments, or even a simple hash argument
    has many key. This is not convenient to test as most tests doesn't
    need to check if the arguments matches perfectly.

    This PR make it possible to only check if a subset of arguments were
    passed to the job.

- When calling `assert_performed_with`/`assert_enqueued_with`, the
  +args+ needs to match exactly what the job get passed.

  Some jobs can have lot of arguments, or even a simple hash argument
  has many key. This is not convenient to test as most tests doesn't
  need to check if the arguments matches perfectly.

  This PR make it possible to only check if a subset of arguments were
  passed to the job.
@rails-bot
Copy link

r? @kaspth

(@rails-bot has picked a reviewer for you, use r? to override)

@rafaelfranca rafaelfranca merged commit dc47bb5 into rails:master Sep 27, 2018
@Edouard-chin Edouard-chin deleted the ec-active-job-subset-arg branch September 27, 2018 18:02
jonathanhefner added a commit to jonathanhefner/rails that referenced this pull request May 7, 2020
PR rails#33995 added support for specifying the `args` argument of
`assert_enqueued_with` and `assert_performed_with` as a matcher proc.
In doing so, it added undocumented support for specifying the other
arguments as matcher procs as well.  This commit officially documents
that support, and adds tests to ensure the behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants