未验证 提交 8ae3d17c 编写于 作者: R Ryuta Kamizono 提交者: GitHub

Merge pull request #33263 from bogdanvlviv/follow-up-33258

Clarify activejob/lib/active_job/test_helper.rb
......@@ -322,8 +322,8 @@ def assert_enqueued_with(job: nil, args: nil, at: nil, queue: nil)
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}"
......
......@@ -471,6 +471,12 @@ def test_assert_enqueued_with_with_no_block_args
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 @@ def test_assert_enqueued_with_failure_with_global_id_args
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 @@ def test_assert_enqueued_with_with_failure_with_no_block_with_global_id_args
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册