DEV: Fix topic timer flaky spec for inheriting from category (#12106)

This commit is contained in:
Martin Brennan 2021-02-17 15:00:06 +10:00 committed by GitHub
parent 355b8f69af
commit 3bfb1b34a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1618,6 +1618,7 @@ describe Topic do
it 'should set a topic timer' do
freeze_time
now = Time.zone.now
expect { topic.change_category_to_id(new_category.id) }
.to change { TopicTimer.count }.by(1)
@ -1628,7 +1629,7 @@ describe Topic do
expect(topic_timer.user).to eq(Discourse.system_user)
expect(topic_timer.topic).to eq(topic)
expect(topic_timer.execute_at).to be_within_one_second_of(5.hours.from_now)
expect(topic_timer.execute_at).to be_within_one_second_of(now + 5.hours)
end
describe 'when topic is already closed' do