FEATURE: add slow_mode_prevents_editing setting..

..as per https://meta.discourse.org/t/slow-mode-for-a-category/179574/16
This commit is contained in:
mintsaxon
2021-06-27 02:09:53 +02:00
committed by Robin Ward
parent 04baca593b
commit 7d0d13c32e
4 changed files with 13 additions and 1 deletions

View File

@ -188,6 +188,16 @@ describe PostRevisor do
expect(post.errors).to be_empty
end
it 'edits are generally allowed' do
SiteSetting.slow_mode_prevents_editing = false
subject.revise!(post.user, { raw: 'updated body' }, revised_at: post.updated_at + 10.minutes)
post.reload
expect(post.errors).to be_empty
end
it 'staff is allowed to edit posts even if the topic is in slow mode' do
admin = Fabricate(:admin)
subject.revise!(admin, { raw: 'updated body' }, revised_at: post.updated_at + 10.minutes)