mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
DEV: Improve flaky time-sensitive specs (#9141)
This commit is contained in:
@ -656,8 +656,11 @@ describe Email::Receiver do
|
||||
end
|
||||
|
||||
it "ensures posts aren't dated in the future" do
|
||||
# PostCreator doesn't provide sub-second accuracy for created_at
|
||||
now = freeze_time Time.zone.now.round
|
||||
|
||||
expect { process(:from_the_future) }.to change { topic.posts.count }
|
||||
expect(topic.posts.last.created_at).to be_within(1.minute).of(DateTime.now)
|
||||
expect(topic.posts.last.created_at).to eq_time(now)
|
||||
end
|
||||
|
||||
it "accepts emails with wrong reply key if the system knows about the forwarded email" do
|
||||
|
Reference in New Issue
Block a user