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

@Edouard-chin Edouard-chin commented Sep 26, 2018

  • 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

@rails-bot rails-bot commented Sep 26, 2018

r? @kaspth

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

@gmcgibbon gmcgibbon added the activejob label Sep 27, 2018
@rafaelfranca rafaelfranca merged commit dc47bb5 into rails:master Sep 27, 2018
2 checks passed
2 checks passed
codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Edouard-chin Edouard-chin deleted the Edouard-chin:ec-active-job-subset-arg branch Sep 27, 2018
jonathanhefner added a commit to jonathanhefner/rails that referenced this pull request Apr 24, 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.
jonathanhefner added a commit to jonathanhefner/rails that referenced this pull request Apr 24, 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.
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.
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
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.