Add confirmation page when importing blocked domains (#1773)
* Move glitch-soc-specific strings to glitch-soc-specific locale files * Add confirmation page when importing blocked domains
This commit is contained in:
@@ -16,6 +16,27 @@ RSpec.describe Admin::DomainBlocksController, type: :controller do
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST #batch' do
|
||||
it 'blocks the domains when succeeded to save' do
|
||||
allow(DomainBlockWorker).to receive(:perform_async).and_return(true)
|
||||
|
||||
post :batch, params: {
|
||||
save: '',
|
||||
form_domain_block_batch: {
|
||||
domain_blocks_attributes: {
|
||||
'0' => { enabled: '1', domain: 'example.com', severity: 'silence' },
|
||||
'1' => { enabled: '0', domain: 'mastodon.social', severity: 'suspend' },
|
||||
'2' => { enabled: '1', domain: 'mastodon.online', severity: 'suspend' }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
expect(DomainBlockWorker).to have_received(:perform_async).exactly(2).times
|
||||
expect(flash[:notice]).to eq I18n.t('admin.domain_blocks.created_msg')
|
||||
expect(response).to redirect_to(admin_instances_path(limited: '1'))
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST #create' do
|
||||
it 'blocks the domain when succeeded to save' do
|
||||
allow(DomainBlockWorker).to receive(:perform_async).and_return(true)
|
||||
|
Reference in New Issue
Block a user