mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-21 17:53:18 +00:00
Use pluck on DomainAllow.allowed_domains for export (#36019)
This commit is contained in:
parent
350a802851
commit
3efba15b3c
5 changed files with 44 additions and 22 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue