mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Disable 'Create Topic' button if tag is staff-only. (#6984)
* FIX: Disable 'Create Topic' button if tag is staff-only. * FIX: Staff-only tags should always return 404.
This commit is contained in:
@@ -216,4 +216,29 @@ describe DiscourseTagging do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "staff_tag_names" do
|
||||
let(:tag) { Fabricate(:tag) }
|
||||
|
||||
let(:staff_tag) { Fabricate(:tag) }
|
||||
let(:other_staff_tag) { Fabricate(:tag) }
|
||||
|
||||
let!(:staff_tag_group) {
|
||||
Fabricate(
|
||||
:tag_group,
|
||||
permissions: { "staff" => 1, "everyone" => 3 },
|
||||
tag_names: [staff_tag.name]
|
||||
)
|
||||
}
|
||||
|
||||
it "returns all staff tags" do
|
||||
expect(DiscourseTagging.staff_tag_names).to contain_exactly(staff_tag.name)
|
||||
|
||||
staff_tag_group.update(tag_names: [staff_tag.name, other_staff_tag.name])
|
||||
expect(DiscourseTagging.staff_tag_names).to contain_exactly(staff_tag.name, other_staff_tag.name)
|
||||
|
||||
staff_tag_group.update(tag_names: [other_staff_tag.name])
|
||||
expect(DiscourseTagging.staff_tag_names).to contain_exactly(other_staff_tag.name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user