mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 12:39:53 +01:00
Floor times in tests
This passed locally for me on macOS but does not pass on Linux due to a difference in precision for timestamps.
This commit is contained in:
parent
eca53de004
commit
81b279f1b6
2 changed files with 2 additions and 2 deletions
|
@ -68,7 +68,7 @@ describe InboxController, type: :controller do
|
|||
it "updates the the timestamp used for caching" do
|
||||
user.update(inbox_updated_at: original_inbox_updated_at)
|
||||
travel 1.second do
|
||||
expect { subject }.to change { user.reload.inbox_updated_at }.from(original_inbox_updated_at).to(Time.now.utc)
|
||||
expect { subject }.to change { user.reload.inbox_updated_at.floor }.from(original_inbox_updated_at.floor).to(Time.now.utc.floor)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ describe NotificationsController do
|
|||
it "updates the the timestamp used for caching" do
|
||||
user.update(notifications_updated_at: original_notifications_updated_at)
|
||||
travel 1.second do
|
||||
expect { subject }.to change { user.reload.notifications_updated_at }.from(original_notifications_updated_at).to(Time.now.utc)
|
||||
expect { subject }.to change { user.reload.notifications_updated_at.floor }.from(original_notifications_updated_at.floor).to(Time.now.utc.floor)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue