refactor(routing): rename routage_custom to custom_routing

This commit is contained in:
Eric Leroy-Terquem 2024-10-17 09:09:28 +02:00
parent b511eb2db7
commit 7caadc3b40
No known key found for this signature in database
GPG key ID: 53D8FAECEF207605
3 changed files with 6 additions and 6 deletions

View file

@ -62,7 +62,7 @@
= render Dsfr::RadioButtonListComponent.new(form: f,
target: :state,
buttons: [ { label: 'À partir dun champ', value: 'routage_simple', hint: 'crée les groupes en fonction dun champ du formulaire' } ,
{ label: 'Avancé', value: 'routage_custom', hint: 'libre à vous de créer et de configurer les groupes' }])
{ label: 'Avancé', value: 'custom_routing', hint: 'libre à vous de créer et de configurer les groupes' }])
%ul.fr-btns-group.fr-btns-group--inline-sm

View file

@ -27,7 +27,7 @@ module Administrateurs
def options
@procedure = procedure
if params[:state] == 'choix' && @procedure.active_revision.simple_routable_types_de_champ.none?
configurate_routage_custom
configurate_custom_routing
end
end
@ -93,14 +93,14 @@ module Administrateurs
end
def wizard
if params[:choice][:state] == 'routage_custom'
configurate_routage_custom
if params[:choice][:state] == 'custom_routing'
configurate_custom_routing
elsif params[:choice][:state] == 'routage_simple'
redirect_to simple_routing_admin_procedure_groupe_instructeurs_path
end
end
def configurate_routage_custom
def configurate_custom_routing
new_label = procedure.defaut_groupe_instructeur.label + ' bis'
procedure.groupe_instructeurs
.create({ label: new_label, instructeurs: [current_administrateur.instructeur] })

View file

@ -1058,7 +1058,7 @@ describe Administrateurs::GroupeInstructeursController, type: :controller do
let!(:drop_down_tdc) { procedure4.draft_revision.types_de_champ.first }
before { patch :wizard, params: { procedure_id: procedure4.id, choice: { state: 'routage_custom' } } }
before { patch :wizard, params: { procedure_id: procedure4.id, choice: { state: 'custom_routing' } } }
it do
expect(response).to redirect_to(admin_procedure_groupe_instructeurs_path(procedure4))