Formulaire → demande, when not editable
This commit is contained in:
parent
b9a32633bb
commit
6b88968889
8 changed files with 14 additions and 14 deletions
|
@ -4,8 +4,8 @@ module NewUser
|
||||||
|
|
||||||
helper_method :new_demarche_url
|
helper_method :new_demarche_url
|
||||||
|
|
||||||
before_action :ensure_ownership!, except: [:index, :show, :formulaire, :modifier, :update, :recherche]
|
before_action :ensure_ownership!, except: [:index, :show, :demande, :modifier, :update, :recherche]
|
||||||
before_action :ensure_ownership_or_invitation!, only: [:show, :formulaire, :modifier, :update]
|
before_action :ensure_ownership_or_invitation!, only: [:show, :demande, :modifier, :update]
|
||||||
before_action :ensure_dossier_can_be_updated, only: [:update_identite, :update]
|
before_action :ensure_dossier_can_be_updated, only: [:update_identite, :update]
|
||||||
before_action :forbid_invite_submission!, only: [:update]
|
before_action :forbid_invite_submission!, only: [:update]
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ module NewUser
|
||||||
@dossier = dossier
|
@dossier = dossier
|
||||||
end
|
end
|
||||||
|
|
||||||
def formulaire
|
def demande
|
||||||
@dossier = dossier
|
@dossier = dossier
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ module NewUser
|
||||||
redirect_to merci_dossier_path(@dossier)
|
redirect_to merci_dossier_path(@dossier)
|
||||||
elsif current_user.owns?(dossier)
|
elsif current_user.owns?(dossier)
|
||||||
if Flipflop.new_dossier_details?
|
if Flipflop.new_dossier_details?
|
||||||
redirect_to formulaire_dossier_path(@dossier)
|
redirect_to demande_dossier_path(@dossier)
|
||||||
else
|
else
|
||||||
redirect_to users_dossier_recapitulatif_path(@dossier)
|
redirect_to users_dossier_recapitulatif_path(@dossier)
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,4 +9,4 @@
|
||||||
|
|
||||||
%ul.tabs
|
%ul.tabs
|
||||||
= active_tab_item('Résumé', dossier_path(dossier))
|
= active_tab_item('Résumé', dossier_path(dossier))
|
||||||
= active_tab_item('Formulaire', formulaire_dossier_path(dossier))
|
= active_tab_item('Demande', demande_dossier_path(dossier))
|
||||||
|
|
|
@ -278,7 +278,7 @@ Rails.application.routes.draw do
|
||||||
get 'modifier'
|
get 'modifier'
|
||||||
patch 'modifier', to: 'dossiers#update'
|
patch 'modifier', to: 'dossiers#update'
|
||||||
get 'merci'
|
get 'merci'
|
||||||
get 'formulaire'
|
get 'demande'
|
||||||
post 'ask_deletion'
|
post 'ask_deletion'
|
||||||
get 'attestation'
|
get 'attestation'
|
||||||
end
|
end
|
||||||
|
|
|
@ -517,10 +517,10 @@ describe NewUser::DossiersController, type: :controller do
|
||||||
sign_in(user)
|
sign_in(user)
|
||||||
end
|
end
|
||||||
|
|
||||||
subject! { get(:formulaire, params: { id: dossier.id }) }
|
subject! { get(:demande, params: { id: dossier.id }) }
|
||||||
|
|
||||||
it { expect(assigns(:dossier)).to eq(dossier) }
|
it { expect(assigns(:dossier)).to eq(dossier) }
|
||||||
it { is_expected.to render_template(:formulaire) }
|
it { is_expected.to render_template(:demande) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#ask_deletion' do
|
describe '#ask_deletion' do
|
||||||
|
|
|
@ -20,16 +20,16 @@ describe 'Dossier details:' do
|
||||||
|
|
||||||
scenario 'the user can see and edit dossier before instruction' do
|
scenario 'the user can see and edit dossier before instruction' do
|
||||||
visit_dossier dossier
|
visit_dossier dossier
|
||||||
click_on 'Formulaire'
|
click_on 'Demande'
|
||||||
|
|
||||||
expect(page).to have_current_path(formulaire_dossier_path(dossier))
|
expect(page).to have_current_path(demande_dossier_path(dossier))
|
||||||
click_on 'Modifier le dossier'
|
click_on 'Modifier le dossier'
|
||||||
|
|
||||||
expect(page).to have_current_path(modifier_dossier_path(dossier))
|
expect(page).to have_current_path(modifier_dossier_path(dossier))
|
||||||
fill_in('texte obligatoire', with: 'Nouveau texte')
|
fill_in('texte obligatoire', with: 'Nouveau texte')
|
||||||
click_on 'Enregistrer les modifications du dossier'
|
click_on 'Enregistrer les modifications du dossier'
|
||||||
|
|
||||||
expect(page).to have_current_path(formulaire_dossier_path(dossier))
|
expect(page).to have_current_path(demande_dossier_path(dossier))
|
||||||
expect(page).to have_content('Nouveau texte')
|
expect(page).to have_content('Nouveau texte')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'new_user/dossiers/formulaire.html.haml', type: :view do
|
describe 'new_user/dossiers/demande.html.haml', type: :view do
|
||||||
let(:procedure) { create(:procedure, :published, :with_two_type_de_piece_justificative, :with_type_de_champ, :with_type_de_champ_private) }
|
let(:procedure) { create(:procedure, :published, :with_two_type_de_piece_justificative, :with_type_de_champ, :with_type_de_champ_private) }
|
||||||
let(:dossier) { create(:dossier, :en_construction, :with_entreprise, procedure: procedure) }
|
let(:dossier) { create(:dossier, :en_construction, :with_entreprise, procedure: procedure) }
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ describe 'new_user/dossiers/formulaire.html.haml', type: :view do
|
||||||
|
|
||||||
it 'renders the dossier infos' do
|
it 'renders the dossier infos' do
|
||||||
expect(rendered).to have_text('Identité')
|
expect(rendered).to have_text('Identité')
|
||||||
expect(rendered).to have_text('Formulaire')
|
expect(rendered).to have_text('Demande')
|
||||||
expect(rendered).to have_text('Pièces jointes')
|
expect(rendered).to have_text('Pièces jointes')
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,6 +10,6 @@ describe 'new_user/dossiers/show/header.html.haml', type: :view do
|
||||||
|
|
||||||
expect(rendered).to have_selector("ul.tabs")
|
expect(rendered).to have_selector("ul.tabs")
|
||||||
expect(rendered).to have_link("Résumé", href: dossier_path(dossier))
|
expect(rendered).to have_link("Résumé", href: dossier_path(dossier))
|
||||||
expect(rendered).to have_link("Formulaire", href: formulaire_dossier_path(dossier))
|
expect(rendered).to have_link("Demande", href: demande_dossier_path(dossier))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue