Fix: 投稿にNGワードが含まれる場合、投稿のモデレーションができなくなる場合がある問題 (#685)

This commit is contained in:
KMY(雪あすか) 2024-04-01 08:54:16 +09:00 committed by GitHub
parent 4a9f549dd2
commit e7aececf5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 23 additions and 8 deletions

View file

@ -277,6 +277,13 @@ RSpec.describe UpdateStatusService do
expect { subject.call(status, status.account_id, text: text) }.to raise_error(Mastodon::ValidationError)
end
it 'bypass ng words' do
text = 'ng word test'
Fabricate(:ng_word, keyword: 'test', stranger: false)
expect { subject.call(status, status.account_id, text: text, bypass_validation: true) }.to_not raise_error
end
it 'not hit ng words' do
text = 'ng word aiueo'
Fabricate(:ng_word, keyword: 'test', stranger: false)