From 70f2ee0cf5d22f4dd6a6baf3b8abce918342d0cf Mon Sep 17 00:00:00 2001 From: Bertocq Date: Sat, 16 Dec 2017 17:58:32 +0100 Subject: [PATCH] Fix Time.now usage to Time.current to include zone --- spec/models/proposal_notification_spec.rb | 2 +- spec/shared/models/notifiable.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/models/proposal_notification_spec.rb b/spec/models/proposal_notification_spec.rb index 704555bdc..349a16838 100644 --- a/spec/models/proposal_notification_spec.rb +++ b/spec/models/proposal_notification_spec.rb @@ -146,7 +146,7 @@ describe ProposalNotification do it "returns false if the resource is retired" do 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) end diff --git a/spec/shared/models/notifiable.rb b/spec/shared/models/notifiable.rb index 4c09a01ce..0733443f0 100644 --- a/spec/shared/models/notifiable.rb +++ b/spec/shared/models/notifiable.rb @@ -78,11 +78,11 @@ shared_examples "notifiable" do notification = create(:notification, notifiable: notifiable) 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) end end end -end \ No newline at end of file +end