* Wip * Wip * Wip: History * Wip: テストコード作成 * Fix test * Wip * Wip * Wip * Fix test * Wip * Wip * Wip * Wip * なんとか完成、これから動作確認 * spell miss * Change ng rule timings * Fix test * Wip * Fix test * Wip * Fix form * 表示まわりの改善
This commit is contained in:
parent
0779c748a6
commit
7d96d5828e
56 changed files with 2062 additions and 42 deletions
|
@ -681,5 +681,31 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService, type: :service do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when ng rule is existing' do
|
||||
context 'when ng rule is match' do
|
||||
before do
|
||||
Fabricate(:ng_rule, account_domain: 'example.com', status_text: 'universe')
|
||||
subject.call(status, json, json)
|
||||
end
|
||||
|
||||
it 'does not update text' do
|
||||
expect(status.reload.text).to eq 'Hello world'
|
||||
expect(status.edits.reload.map(&:text)).to eq []
|
||||
end
|
||||
end
|
||||
|
||||
context 'when ng rule is not match' do
|
||||
before do
|
||||
Fabricate(:ng_rule, account_domain: 'foo.bar', status_text: 'universe')
|
||||
subject.call(status, json, json)
|
||||
end
|
||||
|
||||
it 'updates text' do
|
||||
expect(status.reload.text).to eq 'Hello universe'
|
||||
expect(status.edits.reload.map(&:text)).to eq ['Hello world', 'Hello universe']
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue