diff options
author | Andrew White <andrew.white@unboxed.co> | 2017-03-15 08:19:27 +0000 |
---|---|---|
committer | Andrew White <andrew.white@unboxed.co> | 2017-03-15 08:19:27 +0000 |
commit | ef28b68496c53f4b4aead732ac67803e8e096aa2 (patch) | |
tree | ee4dab18813cd6d600be4f40ca14bd369e9b3160 /actionmailer/test | |
parent | d035f2d0b482744a2f678365699b52a27e739960 (diff) | |
download | rails-ef28b68496c53f4b4aead732ac67803e8e096aa2.tar.gz rails-ef28b68496c53f4b4aead732ac67803e8e096aa2.tar.bz2 rails-ef28b68496c53f4b4aead732ac67803e8e096aa2.zip |
Don't cast to float unnecessarily
Adding durations to `Time` instances is perfectly okay.
Diffstat (limited to 'actionmailer/test')
-rw-r--r-- | actionmailer/test/message_delivery_test.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionmailer/test/message_delivery_test.rb b/actionmailer/test/message_delivery_test.rb index f4c4f43bdc..e3d15816d4 100644 --- a/actionmailer/test/message_delivery_test.rb +++ b/actionmailer/test/message_delivery_test.rb @@ -76,14 +76,14 @@ class MessageDeliveryTest < ActiveSupport::TestCase test "should enqueue a delivery with a delay" do travel_to Time.new(2004, 11, 24, 01, 04, 44) do - assert_performed_with(job: ActionMailer::DeliveryJob, at: Time.current.to_f + 600, args: ["DelayedMailer", "test_message", "deliver_now", 1, 2, 3]) do + assert_performed_with(job: ActionMailer::DeliveryJob, at: Time.current + 600.seconds, args: ["DelayedMailer", "test_message", "deliver_now", 1, 2, 3]) do @mail.deliver_later wait: 600.seconds end end end test "should enqueue a delivery at a specific time" do - later_time = Time.now.to_f + 3600 + later_time = Time.current + 1.hour assert_performed_with(job: ActionMailer::DeliveryJob, at: later_time, args: ["DelayedMailer", "test_message", "deliver_now", 1, 2, 3]) do @mail.deliver_later wait_until: later_time end |