From 4d75f58991ca6b393ded2398de87fe6a13d4ac72 Mon Sep 17 00:00:00 2001 From: Edouard CHIN Date: Wed, 26 Sep 2018 18:45:52 -0400 Subject: Add a way to check for subset of arguments when performing jobs: - 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. --- activejob/CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activejob/CHANGELOG.md') diff --git a/activejob/CHANGELOG.md b/activejob/CHANGELOG.md index 57a62e963d..af5c197bac 100644 --- a/activejob/CHANGELOG.md +++ b/activejob/CHANGELOG.md @@ -1,3 +1,9 @@ +* Allow `assert_enqueued_with`/`assert_performed_with` methods to accept + a proc for the `args` argument. This is useful to check if only a subset of arguments + matches your expectations. + + *Edouard Chin* + * `ActionDispatch::IntegrationTest` includes `ActiveJob::TestHelper` module by default. *Ricardo Díaz* -- cgit v1.2.3