fix(instructeurs/archives/routes): move archives routes under another url schema to avoid conflict with dossier archvied

This commit is contained in:
mfo 2024-11-20 11:35:25 +01:00
parent c260c43dac
commit e6d9ee93a6
No known key found for this signature in database
GPG key ID: 7CE3E1F5B794A8EC
4 changed files with 21 additions and 15 deletions

View file

@ -199,20 +199,19 @@ describe 'Instructing a dossier:', js: true do
expect(page).to have_text("Dossier envoyé")
end
context 'A instructeur can ask for an Archive' do
let(:procedure) { create(:procedure, :published, types_de_champ_public: [{ type: :piece_justificative }], instructeurs: [instructeur]) }
let(:dossier) { create(:dossier, :accepte, procedure: procedure) }
before do
log_in(instructeur.email, password)
visit instructeur_archives_path(procedure)
end
scenario 'download' do
expect {
page.first(".fr-table .fr-btn").click
}.to have_enqueued_job(ArchiveCreationJob).with(procedure, an_instance_of(Archive), instructeur)
expect(Archive.first.month).not_to be_nil
end
scenario 'A instructeur can ask for an Archive', chrome: true do
archivable_procedure = create(:procedure, :published, types_de_champ_public: [{ type: :piece_justificative }], instructeurs: [instructeur])
create(:dossier, :accepte, procedure: archivable_procedure)
log_in(instructeur.email, password)
visit list_instructeur_archives_path(archivable_procedure)
expect {
page.first(".fr-table .fr-btn").click
}.to have_enqueued_job(ArchiveCreationJob).with(archivable_procedure, an_instance_of(Archive), instructeur)
expect(Archive.first.month).not_to be_nil
end
context 'with dossiers having attached files' do
let(:procedure) { create(:procedure, :published, types_de_champ_public: [{ type: :piece_justificative }], instructeurs: [instructeur]) }
let(:dossier) { create(:dossier, :en_construction, procedure: procedure) }