0
0
Fork 0

Improve Report Notes and Account Moderation Notes (#30288)

This commit is contained in:
Emelia Smith 2024-05-15 15:38:36 +02:00 committed by GitHub
parent c2ca3d152f
commit 5fd56512de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 47 additions and 22 deletions

View file

@ -24,10 +24,19 @@ RSpec.describe Admin::AccountModerationNotesController do
end
end
context 'when parameters are invalid' do
context 'when the content is too short' do
let(:params) { { account_moderation_note: { target_account_id: target_account.id, content: '' } } }
it 'falls to create a note' do
it 'fails to create a note' do
expect { subject }.to_not change(AccountModerationNote, :count)
expect(response).to render_template 'admin/accounts/show'
end
end
context 'when the content is too long' do
let(:params) { { account_moderation_note: { target_account_id: target_account.id, content: 'test' * AccountModerationNote::CONTENT_SIZE_LIMIT } } }
it 'fails to create a note' do
expect { subject }.to_not change(AccountModerationNote, :count)
expect(response).to render_template 'admin/accounts/show'
end