mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: don't bump topics when hidden tags are added or removed
This commit is contained in:
@@ -740,6 +740,31 @@ describe PostRevisor do
|
||||
end
|
||||
end
|
||||
|
||||
context "hidden tags" do
|
||||
let(:bumped_at) { 1.day.ago }
|
||||
|
||||
before do
|
||||
topic.update_attributes!(bumped_at: bumped_at)
|
||||
create_hidden_tags(['important', 'secret'])
|
||||
topic = post.topic
|
||||
topic.tags = [Fabricate(:tag, name: "super"), Tag.where(name: "important").first, Fabricate(:tag, name: "stuff")]
|
||||
end
|
||||
|
||||
it "doesn't bump topic if only staff-only tags are added" do
|
||||
expect {
|
||||
result = subject.revise!(Fabricate(:admin), raw: post.raw, tags: topic.tags.map(&:name) + ['secret'])
|
||||
expect(result).to eq(true)
|
||||
}.to_not change { topic.reload.bumped_at }
|
||||
end
|
||||
|
||||
it "doesn't bump topic if only staff-only tags are removed" do
|
||||
expect {
|
||||
result = subject.revise!(Fabricate(:admin), raw: post.raw, tags: topic.tags.map(&:name) - ['important', 'secret'])
|
||||
expect(result).to eq(true)
|
||||
}.to_not change { topic.reload.bumped_at }
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context "cannot create tags" do
|
||||
|
||||
Reference in New Issue
Block a user