From 03fd2f38103b8e22dc75c5e4769f9f90bf0cf3d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 28 Jun 2018 15:08:01 +0200 Subject: Revert "Merge pull request #33243 from evopark/fix/action-mailer-test-helper-no-block" This reverts commit 9d6bbf4e0b2d2b2e2fccd87a778de2893bb28a25, reversing changes made to 5a1ea09062eaed78e21253a128d433a1beb745ad. This method only works with block. --- activejob/lib/active_job/test_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activejob/lib') diff --git a/activejob/lib/active_job/test_helper.rb b/activejob/lib/active_job/test_helper.rb index 43417b8a12..1cd2c40c15 100644 --- a/activejob/lib/active_job/test_helper.rb +++ b/activejob/lib/active_job/test_helper.rb @@ -301,7 +301,7 @@ module ActiveJob original_enqueued_jobs_count = enqueued_jobs.count expected = { job: job, args: args, at: at, queue: queue }.compact serialized_args = serialize_args_for_assertion(expected) - yield if block_given? + yield in_block_jobs = enqueued_jobs.drop(original_enqueued_jobs_count) matching_job = in_block_jobs.find do |in_block_job| serialized_args.all? { |key, value| value == in_block_job[key] } -- cgit v1.2.3