Fix tests - don't test standard rails features

This commit is contained in:
Dan Milne
2025-12-29 19:45:01 +11:00
parent 4c1df53fd5
commit 2a32d75895
5 changed files with 74 additions and 242 deletions

View File

@@ -37,11 +37,14 @@ class ApplicationJobTest < ActiveJob::TestCase
end
assert_enqueued_jobs 1 do
test_job.perform_later("arg1", "arg2", { key: "value" })
test_job.perform_later("arg1", "arg2", { "key" => "value" })
end
# Job class name may be nil in test environment, focus on args
assert_equal ["arg1", "arg2", { key: "value" }], enqueued_jobs.last[:args]
# ActiveJob serializes all hash keys as strings
args = enqueued_jobs.last[:args]
assert_equal "arg1", args[0]
assert_equal "arg2", args[1]
assert_equal "value", args[2]["key"]
end
test "should have default queue configuration" do