fix(instructeurs/archives/routes): move archives routes under another url schema to avoid conflict with dossier archvied
This commit is contained in:
parent
c260c43dac
commit
e6d9ee93a6
4 changed files with 21 additions and 15 deletions
|
@ -56,7 +56,7 @@
|
|||
- if @has_export_notification
|
||||
%span.fr-ml-1v.notifications{ 'aria-label': t('instructeurs.dossiers.header.banner.exports_notification_label') }
|
||||
%li
|
||||
= link_to t('instructeurs.dossiers.header.banner.archives'), instructeur_archives_path(procedure), class: 'fr-nav__link'
|
||||
= link_to t('instructeurs.dossiers.header.banner.archives'), list_instructeur_archives_path(procedure), class: 'fr-nav__link'
|
||||
%li
|
||||
= link_to t('instructeurs.dossiers.header.banner.export_templates'), export_templates_instructeur_procedure_path(procedure), class: 'fr-nav__link'
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
= t('views.instructeurs.dossiers.tab_explainations.suivis')
|
||||
- if @statut == 'traites'
|
||||
%p
|
||||
= t('views.instructeurs.dossiers.tab_explainations.traites_html', archives_path: instructeur_archives_path(@procedure))
|
||||
= t('views.instructeurs.dossiers.tab_explainations.traites_html', archives_path: list_instructeur_archives_path(@procedure))
|
||||
- if @statut == 'tous'
|
||||
%p
|
||||
- if @procedure.routing_enabled?
|
||||
|
|
|
@ -532,6 +532,13 @@ Rails.application.routes.draw do
|
|||
end
|
||||
end
|
||||
|
||||
resources :archives, only: [] do
|
||||
collection do
|
||||
get 'list' => "archives#index"
|
||||
post 'create' => "archives#create"
|
||||
end
|
||||
end
|
||||
|
||||
resources :groupes, only: [:index, :show], controller: 'groupe_instructeurs' do
|
||||
resource :contact_information
|
||||
member do
|
||||
|
|
|
@ -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) }
|
||||
|
|
Loading…
Reference in a new issue