Add a regression test for a removed method in 6.1 #2455
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This method has been moved in rails/rails@3cece0b We do not include ActiveSupport::Testing::Assertion.
This resulted in failures when
perform_enqueued_jobs do
was called from specs.Method was added back in rails/rails#40780, and was released in Rails 6.1.1
6.1.1 does not fix the issue in a spec that contains the following, though:
We never included
perform_enqueued_jobs
method to be available in specs. Everywhere in our docs we recommend settingActiveJob::Base.queue_adapter.perform_enqueued_jobs
totrue
instead for those specs that need to perform jobs inline.To make sure that
assert_nothing_raised
call doesn't blow up, we need to callperform_enqueued_jobs
and for that -include ActiveJob::TestHelper
that contains both of those definitions. And this is what Rails 6.1.1 has fixed.Fixes #2410
Originally from #2412
Side note: It's not uncommon to perform jobs inline and check their side effects. Calling
perform
directly is not a direct replacement, because in this case argument serialization/deserialization is not covered.