* 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
|
@ -820,6 +820,27 @@ RSpec.describe PostStatusService, type: :service do
|
|||
end
|
||||
end
|
||||
|
||||
describe 'ng rule is set' do
|
||||
it 'creates a new status when no rule matches' do
|
||||
Fabricate(:ng_rule, account_username: 'ohagi', status_allow_follower_mention: false)
|
||||
account = Fabricate(:account)
|
||||
text = 'test status update'
|
||||
|
||||
status = subject.call(account, text: text)
|
||||
|
||||
expect(status).to be_persisted
|
||||
expect(status.text).to eq text
|
||||
end
|
||||
|
||||
it 'does not create a new status when a rule matches' do
|
||||
Fabricate(:ng_rule, status_text: 'test', status_allow_follower_mention: false)
|
||||
account = Fabricate(:account)
|
||||
text = 'test status update'
|
||||
|
||||
expect { subject.call(account, text: text) }.to raise_error Mastodon::ValidationError
|
||||
end
|
||||
end
|
||||
|
||||
def create_status_with_options(**options)
|
||||
subject.call(Fabricate(:account), options.merge(text: 'test'))
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue