mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 05:43:16 +08:00
BUGFIX: spec would blow up when DST kicked in
This commit is contained in:
parent
68630af718
commit
3f0964bf60
|
@ -529,20 +529,24 @@ describe Topic do
|
|||
|
||||
context 'topic was set to close when it was created' do
|
||||
it 'puts the autoclose duration in the moderator post' do
|
||||
@topic.created_at = 3.days.ago
|
||||
@topic.update_status(status, true, @user)
|
||||
expect(@topic.posts.last.raw).to include "closed after 3 days"
|
||||
freeze_time(Time.new(2000,1,1)) do
|
||||
@topic.created_at = 3.days.ago
|
||||
@topic.update_status(status, true, @user)
|
||||
expect(@topic.posts.last.raw).to include "closed after 3 days"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'topic was set to close after it was created' do
|
||||
it 'puts the autoclose duration in the moderator post' do
|
||||
@topic.created_at = 7.days.ago
|
||||
Timecop.freeze(2.days.ago) do
|
||||
@topic.set_auto_close(48)
|
||||
freeze_time(Time.new(2000,1,1)) do
|
||||
@topic.created_at = 7.days.ago
|
||||
freeze_time(2.days.ago) do
|
||||
@topic.set_auto_close(48)
|
||||
end
|
||||
@topic.update_status(status, true, @user)
|
||||
expect(@topic.posts.last.raw).to include "closed after 2 days"
|
||||
end
|
||||
@topic.update_status(status, true, @user)
|
||||
expect(@topic.posts.last.raw).to include "closed after 2 days"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user