DEV: Improve flaky time-sensitive specs (#9141)

This commit is contained in:
Jarek Radosz
2020-03-10 22:13:17 +01:00
committed by GitHub
parent f795c1b8e8
commit 29b35aa64c
49 changed files with 334 additions and 331 deletions

View File

@ -1777,14 +1777,14 @@ describe CookedPostProcessor do
small_action = Fabricate(:post, topic: topic, post_type: Post.types[:small_action])
reply = Fabricate(:post, topic: topic, raw: raw)
freeze_time Time.zone.now do
freeze_time do
topic.bumped_at = 1.day.ago
CookedPostProcessor.new(reply).remove_full_quote_on_direct_reply
expect(topic.ordered_posts.pluck(:id))
.to eq([post.id, hidden.id, small_action.id, reply.id])
expect(topic.bumped_at).to eq(1.day.ago)
expect(topic.bumped_at).to eq_time(1.day.ago)
expect(reply.raw).to eq("and this is the third reply")
expect(reply.revisions.count).to eq(1)
expect(reply.revisions.first.modifications["raw"]).to eq([raw, reply.raw])