mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-02-13 21:33:20 +01:00
Compare time using string representation
This commit is contained in:
parent
a5c58da48c
commit
efb9b03295
1 changed files with 2 additions and 1 deletions
|
@ -334,7 +334,8 @@ describe Ajax::AnswerController, :ajax_controller, type: :controller do
|
|||
initial_timestamp = 1.day.ago
|
||||
answer.user.update(inbox_updated_at: initial_timestamp)
|
||||
travel_to 1.day.from_now do
|
||||
expect { subject }.to(change { answer.user.reload.inbox_updated_at }.from(initial_timestamp).to(DateTime.now))
|
||||
# using string representation to avoid precision issues
|
||||
expect { subject }.to(change { answer.user.reload.inbox_updated_at.to_s }.from(initial_timestamp.to_s).to(DateTime.now))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue