aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-06-30 17:48:32 +0900
committerGitHub <noreply@github.com>2018-06-30 17:48:32 +0900
commit8ae3d17c9275cf65ec5891f046ad512bb9e8f9bd (patch)
tree748821b3476e21821ec686b7dba639a9968fda42
parente295e51b83762e04217b3f93fb12a1c7d7ba8ec5 (diff)
parent58271f63144b74f192d0b37a1f7b3a469307974b (diff)
downloadrails-8ae3d17c9275cf65ec5891f046ad512bb9e8f9bd.tar.gz
rails-8ae3d17c9275cf65ec5891f046ad512bb9e8f9bd.tar.bz2
rails-8ae3d17c9275cf65ec5891f046ad512bb9e8f9bd.zip
Merge pull request #33263 from bogdanvlviv/follow-up-33258
Clarify activejob/lib/active_job/test_helper.rb
-rw-r--r--activejob/lib/active_job/test_helper.rb4
-rw-r--r--activejob/test/cases/test_helper_test.rb10
2 files changed, 10 insertions, 4 deletions
diff --git a/activejob/lib/active_job/test_helper.rb b/activejob/lib/active_job/test_helper.rb
index 0a9ca3a814..0ab3c5126d 100644
--- a/activejob/lib/active_job/test_helper.rb
+++ b/activejob/lib/active_job/test_helper.rb
@@ -322,8 +322,8 @@ module ActiveJob
jobs = enqueued_jobs
end
- matching_job = jobs.find do |in_block_job|
- serialized_args.all? { |key, value| value == in_block_job[key] }
+ matching_job = jobs.find do |enqueued_job|
+ serialized_args.all? { |key, value| value == enqueued_job[key] }
end
assert matching_job, "No enqueued job found with #{expected}"
diff --git a/activejob/test/cases/test_helper_test.rb b/activejob/test/cases/test_helper_test.rb
index 3fcac61bed..76d12bee82 100644
--- a/activejob/test/cases/test_helper_test.rb
+++ b/activejob/test/cases/test_helper_test.rb
@@ -471,6 +471,12 @@ class EnqueuedJobsTest < ActiveJob::TestCase
end
end
+ def test_assert_enqueued_with_with_at_option
+ assert_enqueued_with(job: HelloJob, at: Date.tomorrow.noon) do
+ HelloJob.set(wait_until: Date.tomorrow.noon).perform_later
+ end
+ end
+
def test_assert_enqueued_with_with_no_block_with_at_option
HelloJob.set(wait_until: Date.tomorrow.noon).perform_later
assert_enqueued_with(job: HelloJob, at: Date.tomorrow.noon)
@@ -501,7 +507,7 @@ class EnqueuedJobsTest < ActiveJob::TestCase
assert_equal "No enqueued job found with {:job=>HelloJob, :args=>[#{wilma.inspect}]}", error.message
end
- def test_assert_enqueued_with_with_failure_with_no_block_with_global_id_args
+ def test_assert_enqueued_with_failure_with_no_block_with_global_id_args
ricardo = Person.new(9)
wilma = Person.new(11)
error = assert_raise ActiveSupport::TestCase::Assertion do
@@ -512,7 +518,7 @@ class EnqueuedJobsTest < ActiveJob::TestCase
assert_equal "No enqueued job found with {:job=>HelloJob, :args=>[#{wilma.inspect}]}", error.message
end
- def test_assert_enqueued_job_does_not_change_jobs_count
+ def test_assert_enqueued_with_does_not_change_jobs_count
HelloJob.perform_later
assert_enqueued_with(job: HelloJob) do
HelloJob.perform_later