test(routing): test simple routing with communes type de champ
This commit is contained in:
parent
632314bc0e
commit
ccc932f924
1 changed files with 20 additions and 0 deletions
|
@ -742,6 +742,26 @@ describe Administrateurs::GroupeInstructeursController, type: :controller do
|
|||
end
|
||||
end
|
||||
|
||||
context 'with a communes type de champ' do
|
||||
let!(:procedure3) do
|
||||
create(:procedure,
|
||||
types_de_champ_public: [{ type: :communes }],
|
||||
administrateurs: [admin])
|
||||
end
|
||||
|
||||
let!(:communes_tdc) { procedure3.draft_revision.types_de_champ.first }
|
||||
|
||||
before { post :create_simple_routing, params: { procedure_id: procedure3.id, create_simple_routing: { stable_id: communes_tdc.stable_id } } }
|
||||
|
||||
it do
|
||||
expect(response).to redirect_to(admin_procedure_groupe_instructeurs_path(procedure3))
|
||||
expect(flash.notice).to eq 'Les groupes instructeurs ont été ajoutés'
|
||||
expect(procedure3.groupe_instructeurs.pluck(:label)).to include("01 – Ain")
|
||||
expect(procedure3.reload.defaut_groupe_instructeur.routing_rule).to eq(ds_eq(champ_value(communes_tdc.stable_id), constant('01')))
|
||||
expect(procedure3.routing_enabled).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
context 'with a departements type de champ' do
|
||||
let!(:procedure3) do
|
||||
create(:procedure,
|
||||
|
|
Loading…
Reference in a new issue