0
0
Fork 0

Fix ArgumentError in /api/v1/admin/accounts/:id/action (#25386)

This commit is contained in:
Daniel M Brasil 2023-06-14 10:21:36 -03:00 committed by GitHub
parent b9e8d2b352
commit d9c6f70cc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View file

@ -55,6 +55,22 @@ RSpec.describe Admin::AccountAction do
end
end
context 'when type is invalid' do
let(:type) { 'whatever' }
it 'raises an invalid record error' do
expect { subject }.to raise_error(ActiveRecord::RecordInvalid)
end
end
context 'when type is not given' do
let(:type) { '' }
it 'raises an invalid record error' do
expect { subject }.to raise_error(ActiveRecord::RecordInvalid)
end
end
it 'creates Admin::ActionLog' do
expect do
subject