mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 14:45:56 +08:00
Fix repository ZIP export test to work with enabled workers [SCI-2646]
This commit is contained in:
parent
8fe0249f45
commit
2f6a6072e1
|
@ -34,8 +34,6 @@ class TeamZipExport < ZipExport
|
|||
FileUtils.rm_rf([dir_to_zip, output_file], secure: true)
|
||||
generate_notification(user)
|
||||
end
|
||||
|
||||
zip_file.path
|
||||
end
|
||||
|
||||
handle_asynchronously :generate_exportable_zip
|
||||
|
|
|
@ -64,8 +64,6 @@ class ZipExport < ApplicationRecord
|
|||
FileUtils.rm_rf([dir_to_zip, output_file], secure: true)
|
||||
generate_notification(user)
|
||||
end
|
||||
|
||||
zip_file.path
|
||||
end
|
||||
|
||||
handle_asynchronously :generate_exportable_zip
|
||||
|
|
|
@ -64,8 +64,9 @@ describe RepositoryZipExport, type: :background_job do
|
|||
end
|
||||
|
||||
it 'generates a zip with csv file with exported rows' do
|
||||
csv_zip_path = RepositoryZipExport.generate_zip(params, repository, user)
|
||||
parsed_csv_content = Zip::File.open(csv_zip_path) do |zip_file|
|
||||
RepositoryZipExport.generate_zip(params, repository, user)
|
||||
csv_zip_file = ZipExport.first.zip_file
|
||||
parsed_csv_content = Zip::File.open(csv_zip_file.path) do |zip_file|
|
||||
csv_file = zip_file.glob('*.csv').first
|
||||
csv_content = csv_file.get_input_stream.read
|
||||
CSV.parse(csv_content, headers: true)
|
||||
|
|
Loading…
Reference in a new issue