Fix assert_performed_with time tests

This commit is contained in:
Gannon McGibbon 2019-03-25 01:31:17 -04:00
parent 6a5c8b9199
commit dbd1db91d9
1 changed files with 9 additions and 9 deletions

View File

@ -1710,28 +1710,28 @@ class PerformedJobsTest < ActiveJob::TestCase
def test_assert_performed_with_time
now = Time.now
args = [{ argument1: { now: now } }]
args = [{ argument1: { now: now }, argument2: now }]
assert_enqueued_with(job: MultipleKwargsJob, args: args) do
MultipleKwargsJob.perform_later(argument1: { now: now })
assert_performed_with(job: MultipleKwargsJob, args: args) do
MultipleKwargsJob.perform_later(argument1: { now: now }, argument2: now)
end
end
def test_assert_performed_with_date_time
now = DateTime.now
args = [{ argument1: { now: now } }]
args = [{ argument1: { now: now }, argument2: now }]
assert_enqueued_with(job: MultipleKwargsJob, args: args) do
MultipleKwargsJob.perform_later(argument1: { now: now })
assert_performed_with(job: MultipleKwargsJob, args: args) do
MultipleKwargsJob.perform_later(argument1: { now: now }, argument2: now)
end
end
def test_assert_performed_with_time_with_zone
now = Time.now.in_time_zone("Tokyo")
args = [{ argument1: { now: now } }]
args = [{ argument1: { now: now }, argument2: now }]
assert_enqueued_with(job: MultipleKwargsJob, args: args) do
MultipleKwargsJob.perform_later(argument1: { now: now })
assert_performed_with(job: MultipleKwargsJob, args: args) do
MultipleKwargsJob.perform_later(argument1: { now: now }, argument2: now)
end
end