parent
c147b6dc37
commit
44af34f306
4 changed files with 35 additions and 6 deletions
|
@ -666,6 +666,18 @@ RSpec.describe PostStatusService do
|
|||
expect(status.text).to eq text
|
||||
end
|
||||
|
||||
it 'does not hit ng words for mention to self' do
|
||||
account = Fabricate(:account, username: 'cool', domain: nil)
|
||||
text = 'ng word test @cool'
|
||||
Form::AdminSettings.new(stranger_mention_from_local_ng: '1').save
|
||||
Fabricate(:ng_word, keyword: 'test', stranger: true)
|
||||
|
||||
status = subject.call(account, text: text)
|
||||
|
||||
expect(status).to be_persisted
|
||||
expect(status.text).to eq text
|
||||
end
|
||||
|
||||
it 'hit ng words for reply' do
|
||||
account = Fabricate(:account)
|
||||
text = 'ng word test'
|
||||
|
@ -728,6 +740,19 @@ RSpec.describe PostStatusService do
|
|||
expect(status.text).to eq text
|
||||
end
|
||||
|
||||
it 'does not hit ng words for reference to self' do
|
||||
target_status = Fabricate(:status)
|
||||
account = target_status.account
|
||||
text = "ng word test BT: #{ActivityPub::TagManager.instance.uri_for(target_status)}"
|
||||
Form::AdminSettings.new(stranger_mention_from_local_ng: '1').save
|
||||
Fabricate(:ng_word, keyword: 'test', stranger: true)
|
||||
|
||||
status = subject.call(account, text: text)
|
||||
|
||||
expect(status).to be_persisted
|
||||
expect(status.text).to eq text
|
||||
end
|
||||
|
||||
it 'using hashtag under limit' do
|
||||
account = Fabricate(:account)
|
||||
text = '#a #b'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue