Fix Time.now usage to Time.current to include zone

This commit is contained in:
Bertocq
2017-12-16 17:58:32 +01:00
parent b02e2729e7
commit 70f2ee0cf5
2 changed files with 3 additions and 3 deletions

View File

@@ -146,7 +146,7 @@ describe ProposalNotification do
it "returns false if the resource is retired" do it "returns false if the resource is retired" do
notification = create(:notification, notifiable: notifiable) notification = create(:notification, notifiable: notifiable)
notifiable.proposal.update(retired_at: Time.now) notifiable.proposal.update(retired_at: Time.current)
expect(notification.check_availability(proposal)).to be(false) expect(notification.check_availability(proposal)).to be(false)
end end

View File

@@ -78,11 +78,11 @@ shared_examples "notifiable" do
notification = create(:notification, notifiable: notifiable) notification = create(:notification, notifiable: notifiable)
if notifiable.respond_to?(:retired_at) if notifiable.respond_to?(:retired_at)
notifiable.update(retired_at: Time.now) notifiable.update(retired_at: Time.current)
expect(notification.check_availability(notifiable)).to be(false) expect(notification.check_availability(notifiable)).to be(false)
end end
end end
end end
end end