Groupe instructeur selector default blank

This commit is contained in:
Paul Chavard 2021-03-09 11:21:30 +01:00
parent 9c3e72c84a
commit 70500e3d56
11 changed files with 124 additions and 69 deletions

View file

@ -63,9 +63,20 @@ describe 'shared/dossiers/champs.html.haml', type: :view do
let(:dossier) { create(:dossier, procedure: procedure) }
let(:champs) { [] }
it "renders the routing criteria name and its value" do
expect(subject).to include(procedure.routing_criteria_name)
expect(subject).to include(dossier.groupe_instructeur.label)
it "does not render the routing criteria name and its value" do
expect(subject).not_to include(procedure.routing_criteria_name)
expect(subject).not_to include(dossier.procedure.defaut_groupe_instructeur.label)
end
context "with selected groupe instructeur" do
before do
dossier.groupe_instructeur = dossier.procedure.defaut_groupe_instructeur
end
it "renders the routing criteria name and its value" do
expect(subject).to include(procedure.routing_criteria_name)
expect(subject).to include(dossier.groupe_instructeur.label)
end
end
context "with seen_at" do

View file

@ -98,7 +98,17 @@ describe 'shared/dossiers/edit.html.haml', type: :view do
it 'renders the routing criteria name and its value' do
expect(subject).to have_field(procedure.routing_criteria_name)
expect(subject).to include(dossier.groupe_instructeur.label)
end
context 'when groupe instructeur is selected' do
before do
dossier.groupe_instructeur = dossier.procedure.defaut_groupe_instructeur
end
it 'renders the routing criteria name and its value' do
expect(subject).to have_field(procedure.routing_criteria_name)
expect(subject).to include(dossier.groupe_instructeur.label)
end
end
end
end