feat(instructeur): can flag a dossier as "pending corrections"

This commit is contained in:
Colin Darie 2023-03-14 17:23:17 +01:00
parent 5d61c6fa35
commit ca3b127942
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
13 changed files with 254 additions and 32 deletions

View file

@ -29,15 +29,25 @@ describe 'instructeurs/dossiers/instruction_button', type: :view do
end
end
context 'en_construction' do
let(:dossier) { create(:dossier, :en_construction) }
it 'renders a dropdown' do
expect(rendered).to have_dropdown_title('Demander une modification')
expect(rendered).to have_dropdown_items(count: 2) # form is already expanded so we have 2 visible items
end
end
context 'en_instruction' do
let(:dossier) { create(:dossier, :en_instruction) }
it 'renders a dropdown' do
expect(rendered).to have_dropdown_title('Instruire le dossier')
expect(rendered).to have_dropdown_items(count: 3)
expect(rendered).to have_dropdown_items(count: 4)
expect(rendered).to have_dropdown_item('Accepter')
expect(rendered).to have_dropdown_item('Classer sans suite')
expect(rendered).to have_dropdown_item('Refuser')
expect(rendered).to have_dropdown_item('Demander une modification')
end
end
end

View file

@ -61,7 +61,8 @@ describe 'instructeurs/dossiers/show', type: :view do
within("form[action=\"#{follow_instructeur_dossier_path(dossier.procedure, dossier)}\"]") do
expect(subject).to have_button('Suivre le dossier')
end
expect(subject).to have_selector('.header-actions ul:first-child .fr-btn', count: 2)
expect(subject).to have_button('Demander une modification')
expect(subject).to have_selector('.header-actions ul:first-child > li.instruction-button', count: 1)
end
end