mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-12 05:24:56 +00:00
Avoid double request in admin/export_domain_allows
controller spec (#33255)
This commit is contained in:
parent
f6daf73286
commit
f721e76d13
|
@ -32,15 +32,16 @@ RSpec.describe Admin::ExportDomainAllowsController do
|
||||||
it 'allows imported domains' do
|
it 'allows imported domains' do
|
||||||
post :import, params: { admin_import: { data: fixture_file_upload('domain_allows.csv') } }
|
post :import, params: { admin_import: { data: fixture_file_upload('domain_allows.csv') } }
|
||||||
|
|
||||||
expect(response).to redirect_to(admin_instances_path)
|
expect(response)
|
||||||
|
.to redirect_to(admin_instances_path)
|
||||||
|
|
||||||
# Header should not be imported
|
# Header row should not be imported, but domains should
|
||||||
expect(DomainAllow.where(domain: '#domain').present?).to be(false)
|
expect(DomainAllow)
|
||||||
|
.to_not exist(domain: '#domain')
|
||||||
# Domains should now be added
|
expect(DomainAllow)
|
||||||
get :export, params: { format: :csv }
|
.to exist(domain: 'good.domain')
|
||||||
expect(response).to have_http_status(200)
|
expect(DomainAllow)
|
||||||
expect(response.body).to eq(domain_allows_csv_file)
|
.to exist(domain: 'better.domain')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'displays error on no file selected' do
|
it 'displays error on no file selected' do
|
||||||
|
|
Loading…
Reference in a new issue