mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Use Timecop.freeze instead of Timecop.travel.
This commit is contained in:
@@ -147,8 +147,9 @@ describe PostAlerter do
|
||||
admin2 = Fabricate(:admin)
|
||||
|
||||
# Travel 1 hour in time to test that order post_actions by `created_at`
|
||||
Timecop.travel(Time.zone.now + 1.hour)
|
||||
PostAction.act(admin2, post, PostActionType.types[:like])
|
||||
Timecop.freeze(1.hour.from_now) do
|
||||
PostAction.act(admin2, post, PostActionType.types[:like])
|
||||
end
|
||||
|
||||
expect(Notification.where(post_number: 1, topic_id: post.topic_id).count)
|
||||
.to eq(1)
|
||||
|
||||
Reference in New Issue
Block a user