mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 21:12:45 +08:00
Additional spec test function added and fixed the existing
This commit is contained in:
parent
776ab73a8d
commit
4d842ef2d5
|
@ -80,6 +80,7 @@ describe TopicViewSerializer do
|
|||
describe 'when tags added to private message topics' do
|
||||
before do
|
||||
SiteSetting.tagging_enabled = true
|
||||
SiteSetting.allow_staff_to_tag_in_pm = true
|
||||
end
|
||||
|
||||
it "should not include the tag for normal users" do
|
||||
|
@ -94,5 +95,15 @@ describe TopicViewSerializer do
|
|||
json = serialize_topic(pm, Fabricate(:admin))
|
||||
expect(json[:tags]).to eq([tag.name])
|
||||
end
|
||||
|
||||
it "should not include the tag if pm tags disabled" do
|
||||
SiteSetting.allow_staff_to_tag_in_pm = false
|
||||
|
||||
json = serialize_topic(pm, moderator)
|
||||
expect(json[:tags]).to eq(nil)
|
||||
|
||||
json = serialize_topic(pm, Fabricate(:admin))
|
||||
expect(json[:tags]).to eq(nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user