Fix repository ZIP export test to work with enabled workers [SCI-2646]

This commit is contained in:
Matej Zrimšek 2018-11-07 06:14:40 +01:00
parent 8fe0249f45
commit 2f6a6072e1
3 changed files with 3 additions and 6 deletions

View file

@ -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

View file

@ -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

View file

@ -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)