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
|
@ -68,7 +68,7 @@ describe InboxController, type: :controller do
|
||||||
it "updates the the timestamp used for caching" do
|
it "updates the the timestamp used for caching" do
|
||||||
user.update(inbox_updated_at: original_inbox_updated_at)
|
user.update(inbox_updated_at: original_inbox_updated_at)
|
||||||
travel 1.second do
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ describe NotificationsController do
|
||||||
it "updates the the timestamp used for caching" do
|
it "updates the the timestamp used for caching" do
|
||||||
user.update(notifications_updated_at: original_notifications_updated_at)
|
user.update(notifications_updated_at: original_notifications_updated_at)
|
||||||
travel 1.second do
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue