aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test/message_delivery_test.rb
diff options
context:
space:
mode:
authorAndrew White <andrew.white@unboxed.co>2017-03-15 08:19:27 +0000
committerAndrew White <andrew.white@unboxed.co>2017-03-15 08:19:27 +0000
commitef28b68496c53f4b4aead732ac67803e8e096aa2 (patch)
treeee4dab18813cd6d600be4f40ca14bd369e9b3160 /actionmailer/test/message_delivery_test.rb
parentd035f2d0b482744a2f678365699b52a27e739960 (diff)
downloadrails-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/message_delivery_test.rb')
-rw-r--r--actionmailer/test/message_delivery_test.rb4
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