Disallow revision edits with empty raw content

This commit is contained in:
Penar Musaraj
2018-11-12 15:28:38 -05:00
parent 44d95ad5ab
commit 4f81bb8303
2 changed files with 11 additions and 0 deletions

View File

@@ -114,6 +114,15 @@ describe PostRevisor do
end
end
describe 'with nil raw contents' do
it "doesn't change version" do
expect {
expect(subject.revise!(post.user, raw: nil)).to eq(false)
post.reload
}.not_to change(post, :version)
end
end
describe 'ninja editing' do
it 'correctly applies edits' do
SiteSetting.editing_grace_period = 1.minute