Merge pull request #2347 from betagouv/remove-show-route-hack
Supprime un hack sur les URLs "DossiersController#show"
This commit is contained in:
commit
d1613b4af1
3 changed files with 4 additions and 6 deletions
|
@ -4,7 +4,7 @@
|
||||||
- if apercu
|
- if apercu
|
||||||
- form_options = { url: '', method: :get, html: { class: 'form', multipart: true } }
|
- form_options = { url: '', method: :get, html: { class: 'form', multipart: true } }
|
||||||
- else
|
- else
|
||||||
- form_options = { html: { class: 'form', multipart: true, novalidate: dossier.brouillon? } }
|
- form_options = { url: modifier_dossier_url(dossier), method: :patch, html: { class: 'form', multipart: true, novalidate: dossier.brouillon? } }
|
||||||
|
|
||||||
= form_for dossier, form_options do |f|
|
= form_for dossier, form_options do |f|
|
||||||
|
|
||||||
|
|
|
@ -243,6 +243,7 @@ Rails.application.routes.draw do
|
||||||
get 'identite'
|
get 'identite'
|
||||||
patch 'update_identite'
|
patch 'update_identite'
|
||||||
get 'modifier'
|
get 'modifier'
|
||||||
|
patch 'modifier', to: 'dossiers#update'
|
||||||
get 'merci'
|
get 'merci'
|
||||||
post 'ask_deletion'
|
post 'ask_deletion'
|
||||||
get 'attestation'
|
get 'attestation'
|
||||||
|
@ -250,9 +251,6 @@ Rails.application.routes.draw do
|
||||||
|
|
||||||
collection do
|
collection do
|
||||||
post 'recherche'
|
post 'recherche'
|
||||||
# FIXME: to remove when show is implemeted
|
|
||||||
# needed to fix refresh after dossier draft save
|
|
||||||
get ':id', to: redirect('/dossiers/%{id}/modifier')
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -96,12 +96,12 @@ feature 'The user' do
|
||||||
click_on 'Enregistrer le brouillon'
|
click_on 'Enregistrer le brouillon'
|
||||||
expect(user_dossier.reload.brouillon?).to be(true)
|
expect(user_dossier.reload.brouillon?).to be(true)
|
||||||
expect(page).to have_content('Votre brouillon a bien été sauvegardé')
|
expect(page).to have_content('Votre brouillon a bien été sauvegardé')
|
||||||
expect(page).to have_current_path(dossier_path(user_dossier))
|
expect(page).to have_current_path(modifier_dossier_path(user_dossier))
|
||||||
|
|
||||||
# Check an incomplete dossier cannot be submitted when mandatory fields are missing
|
# Check an incomplete dossier cannot be submitted when mandatory fields are missing
|
||||||
click_on 'Soumettre le dossier'
|
click_on 'Soumettre le dossier'
|
||||||
expect(user_dossier.reload.brouillon?).to be(true)
|
expect(user_dossier.reload.brouillon?).to be(true)
|
||||||
expect(page).to have_current_path(dossier_path(user_dossier))
|
expect(page).to have_current_path(modifier_dossier_path(user_dossier))
|
||||||
|
|
||||||
# Check a dossier can be submitted when all mandatory fields are filled
|
# Check a dossier can be submitted when all mandatory fields are filled
|
||||||
fill_in('texte obligatoire', with: 'super texte')
|
fill_in('texte obligatoire', with: 'super texte')
|
||||||
|
|
Loading…
Add table
Reference in a new issue