1
0
Fork 0
forked from gitea/nas

Expand coverage of admin/*blocks areas (#33594)

This commit is contained in:
Matt Jankowski 2025-01-15 02:47:34 -05:00 committed by GitHub
parent 68c9f91ccb
commit 9f03e5b53a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 43 additions and 3 deletions

View file

@ -48,6 +48,27 @@ RSpec.describe 'Admin::IpBlocks' do
end
end
context 'with a selected block' do
let!(:ip_block) { Fabricate :ip_block }
it 'deletes the block' do
visit admin_ip_blocks_path
check_item
expect { click_on button_for_delete }
.to change(IpBlock, :count).by(-1)
expect { ip_block.reload }
.to raise_error(ActiveRecord::RecordNotFound)
end
end
def check_item
within '.batch-table__row' do
find('input[type=checkbox]').check
end
end
def button_for_delete
I18n.t('admin.ip_blocks.delete')
end