2
0

Use pluck on DomainAllow.allowed_domains for export (#36019)

This commit is contained in:
Matt Jankowski
2025-09-05 08:30:18 -04:00
committed by GitHub
parent 350a802851
commit 3efba15b3c
5 changed files with 44 additions and 22 deletions

View File

@@ -17,17 +17,6 @@ RSpec.describe Admin::ExportDomainAllowsController do
end
end
describe 'GET #export' do
it 'renders instances' do
Fabricate(:domain_allow, domain: 'good.domain')
Fabricate(:domain_allow, domain: 'better.domain')
get :export, params: { format: :csv }
expect(response).to have_http_status(200)
expect(response.body).to eq(domain_allows_csv_file)
end
end
describe 'POST #import' do
it 'allows imported domains' do
post :import, params: { admin_import: { data: fixture_file_upload('domain_allows.csv') } }
@@ -50,10 +39,4 @@ RSpec.describe Admin::ExportDomainAllowsController do
expect(flash[:error]).to eq(I18n.t('admin.export_domain_allows.no_file'))
end
end
private
def domain_allows_csv_file
File.read(File.join(file_fixture_path, 'domain_allows.csv'))
end
end