2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-04 08:47:37 +08:00

FIX: Don't lock a post on edit unless the raw changes

This commit is contained in:
Robin Ward 2018-03-01 20:33:04 -05:00
parent 5c93d07d2a
commit b3883f5c32
2 changed files with 18 additions and 3 deletions

View file

@ -452,6 +452,18 @@ describe PostRevisor do
expect(post).to be_locked
end
it "doesn't lock the post when the raw did not change" do
result = subject.revise!(
moderator,
title: "New topic title, cool!"
)
expect(result).to eq(true)
post.reload
expect(post.topic.title).to eq("New topic title, cool!")
expect(post).not_to be_locked
end
it "doesn't lock the post when revised by a regular user" do
result = subject.revise!(
Fabricate(:user),