FIX: Delete topic timer after completion.

This commit is contained in:
Guo Xiang Tan
2017-05-12 10:28:51 +08:00
parent accd78cd8c
commit 8eecd42856
6 changed files with 11 additions and 5 deletions

View File

@ -79,9 +79,11 @@ describe Topic do
context 'topic is closed manually' do
it 'should remove the schedule to auto-close the topic' do
Timecop.freeze do
topic_timer_id = staff_topic.topic_timer.id
staff_topic.update_status('closed', true, admin)
expect(staff_topic.topic_status_update.reload.deleted_at)
expect(TopicTimer.with_deleted.find(topic_timer_id).deleted_at)
.to be_within(1.second).of(Time.zone.now)
end
end