mirror of
https://github.com/discourse/discourse.git
synced 2025-09-04 08:47:37 +08:00
Remove censored_pattern site setting, which is replaced by watched words
This commit is contained in:
parent
5ca5817902
commit
3313072957
31 changed files with 28 additions and 102 deletions
|
@ -776,15 +776,6 @@ describe PrettyText do
|
|||
end
|
||||
end
|
||||
|
||||
describe "censored_pattern site setting" do
|
||||
it "can be cleared if it causes cooking to timeout" do
|
||||
SiteSetting.censored_pattern = "evilregex"
|
||||
described_class.stubs(:markdown).raises(MiniRacer::ScriptTerminatedError)
|
||||
PrettyText.cook("Protect against it plz.") rescue nil
|
||||
expect(SiteSetting.censored_pattern).to be_blank
|
||||
end
|
||||
end
|
||||
|
||||
it "replaces skin toned emoji" do
|
||||
expect(PrettyText.cook("hello 👱🏿♀️")).to eq("<p>hello <img src=\"/images/emoji/twitter/blonde_woman/6.png?v=5\" title=\":blonde_woman:t6:\" class=\"emoji\" alt=\":blonde_woman:t6:\"></p>")
|
||||
expect(PrettyText.cook("hello 👩🎤")).to eq("<p>hello <img src=\"/images/emoji/twitter/woman_singer.png?v=5\" title=\":woman_singer:\" class=\"emoji\" alt=\":woman_singer:\"></p>")
|
||||
|
|
|
@ -30,22 +30,6 @@ describe Topic do
|
|||
context "#title" do
|
||||
it { is_expected.to validate_presence_of :title }
|
||||
|
||||
describe 'censored pattern' do
|
||||
describe 'when title matches censored pattern' do
|
||||
it 'should not be valid' do
|
||||
SiteSetting.censored_pattern = 'orange.*'
|
||||
|
||||
topic.title = 'I have orangEjuice orange monkey orange stuff'
|
||||
|
||||
expect(topic).to_not be_valid
|
||||
|
||||
expect(topic.errors.full_messages.first).to include(I18n.t(
|
||||
'errors.messages.matches_censored_pattern', censored_words: 'orangejuice orange monkey orange stuff'
|
||||
))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'censored words' do
|
||||
after do
|
||||
$redis.flushall
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue