2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-10-10 10:09:20 +02:00
|
|
|
describe ExportJob do
|
2024-02-07 17:33:34 +01:00
|
|
|
let(:procedure) { create(:procedure, instructeurs: [user_profile]) }
|
|
|
|
let(:user_profile) { create(:instructeur) }
|
2023-10-10 10:09:20 +02:00
|
|
|
let(:time_span_type) { :everything }
|
|
|
|
let(:status) { :tous }
|
|
|
|
let(:key) { '123' }
|
|
|
|
let(:export) do
|
|
|
|
create(:export, format:,
|
|
|
|
time_span_type:,
|
|
|
|
key:,
|
2024-02-07 17:33:34 +01:00
|
|
|
user_profile:,
|
2023-10-10 10:09:20 +02:00
|
|
|
groupe_instructeurs: procedure.groupe_instructeurs)
|
|
|
|
end
|
|
|
|
|
|
|
|
subject do
|
|
|
|
ExportJob.perform_now(export)
|
|
|
|
end
|
|
|
|
before do
|
|
|
|
allow_any_instance_of(ArchiveUploader).to receive(:syscall_to_custom_uploader).and_return(true)
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'zip' do
|
|
|
|
let(:format) { :zip }
|
|
|
|
|
|
|
|
it 'does not try to identify file' do
|
2023-11-09 17:27:55 +01:00
|
|
|
expect { subject }.not_to raise_error
|
2023-10-10 10:09:20 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|