FIX: synonym tags are not considered as unused (#23950)

Currently, `Tag.unused` scope is used to delete unused tags on `/tags` and by CleanUpTags job. Synonym tags, should not be included and treated as unused. Synonyms are only deleted when main tag is deleted:

https://github.com/discourse/discourse/blob/main/app/models/tag.rb#L57
This commit is contained in:
Krzysztof Kotlarek
2023-10-17 10:53:02 +11:00
committed by GitHub
parent ee9aa02ab3
commit 09eca87c76
2 changed files with 2 additions and 1 deletions

View File

@ -299,6 +299,7 @@ RSpec.describe Tag do
)
end
let!(:tag_group) { Fabricate(:tag_group, tag_names: [tag_in_group.name]) }
let!(:synonym_tag) { Fabricate(:tag, target_tag: tags.first) }
it "returns the correct tags" do
expect(Tag.unused.pluck(:name)).to contain_exactly("unused1", "unused2")