add specs
This commit is contained in:
parent
b4a7b4bfbd
commit
93c3761107
7 changed files with 129 additions and 30 deletions
|
@ -1429,13 +1429,13 @@ describe Instructeurs::DossiersController, type: :controller do
|
|||
describe '#pieces_jointes' do
|
||||
let(:procedure) { create(:procedure, :published, types_de_champ_public: [{ type: :piece_justificative }], instructeurs:) }
|
||||
let(:dossier) { create(:dossier, :en_construction, :with_populated_champs, procedure: procedure) }
|
||||
let(:path) { 'spec/fixtures/files/logo_test_procedure.png' }
|
||||
|
||||
before do
|
||||
dossier.champs.first.piece_justificative_file.attach(
|
||||
io: StringIO.new("image file"),
|
||||
filename: "image.jpeg",
|
||||
content_type: "image/jpeg",
|
||||
# we don't want to run virus scanner on this file
|
||||
io: File.open(path),
|
||||
filename: "logo_test_procedure.png",
|
||||
content_type: "image/png",
|
||||
metadata: { virus_scan_result: ActiveStorage::VirusScanner::SAFE }
|
||||
)
|
||||
get :pieces_jointes, params: {
|
||||
|
@ -1446,7 +1446,7 @@ describe Instructeurs::DossiersController, type: :controller do
|
|||
|
||||
it do
|
||||
expect(response.body).to include('Télécharger le fichier toto.txt')
|
||||
expect(response.body).to include('Télécharger le fichier image.jpeg')
|
||||
expect(response.body).to include('Télécharger le fichier logo_test_procedure.png')
|
||||
expect(response.body).to include('Visualiser')
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue