mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 14:48:03 +08:00
FIX: removing hidden tag bumps topic when all tags are removed
JS sends empty string to remove all tags.
This commit is contained in:
@ -762,6 +762,14 @@ describe PostRevisor do
|
||||
}.to_not change { topic.reload.bumped_at }
|
||||
end
|
||||
|
||||
it "doesn't bump topic if empty string is given" do
|
||||
topic.tags = Tag.where(name: ['important', 'secret']).to_a
|
||||
expect {
|
||||
result = subject.revise!(Fabricate(:admin), raw: post.raw, tags: [""])
|
||||
expect(result).to eq(true)
|
||||
}.to_not change { topic.reload.bumped_at }
|
||||
end
|
||||
|
||||
it "creates a hidden revision" do
|
||||
subject.revise!(Fabricate(:admin), raw: post.raw, tags: topic.tags.map(&:name) + ['secret'])
|
||||
expect(post.reload.revisions.first.hidden).to eq(true)
|
||||
|
Reference in New Issue
Block a user