2
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
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