Merge pull request #27094 from y-yagi/remove_warnings_from_activejob_test_helper

remove Ruby warning from Active Job test helper methods
This commit is contained in:
Kasper Timm Hansen 2016-11-18 11:15:56 +01:00 committed by GitHub
commit 8dbc1ca339

@ -238,8 +238,8 @@ def assert_enqueued_with(job: nil, args: nil, at: nil, queue: nil)
serialized_args = serialize_args_for_assertion(expected)
yield
in_block_jobs = enqueued_jobs.drop(original_enqueued_jobs_count)
matching_job = in_block_jobs.find do |job|
serialized_args.all? { |key, value| value == job[key] }
matching_job = in_block_jobs.find do |in_block_job|
serialized_args.all? { |key, value| value == in_block_job[key] }
end
assert matching_job, "No enqueued job found with #{expected}"
instantiate_job(matching_job)
@ -262,8 +262,8 @@ def assert_performed_with(job: nil, args: nil, at: nil, queue: nil)
serialized_args = serialize_args_for_assertion(expected)
perform_enqueued_jobs { yield }
in_block_jobs = performed_jobs.drop(original_performed_jobs_count)
matching_job = in_block_jobs.find do |job|
serialized_args.all? { |key, value| value == job[key] }
matching_job = in_block_jobs.find do |in_block_job|
serialized_args.all? { |key, value| value == in_block_job[key] }
end
assert matching_job, "No performed job found with #{expected}"
instantiate_job(matching_job)