0f542527fb
- changement du design - tableau visible seulement si plus d'une procédure
47 lines
1.5 KiB
Ruby
47 lines
1.5 KiB
Ruby
describe 'instructeurs/procedures/_synthese.html.haml', type: :view do
|
|
let(:current_instructeur) { create(:instructeur) }
|
|
let(:procedure) { create(:procedure) }
|
|
let!(:dossier) { create(:dossier, procedure: procedure) }
|
|
|
|
context 'when instructeur has 2 procedures and 1 file, table is shown' do
|
|
let(:procedure2) { create(:procedure) }
|
|
|
|
subject {
|
|
render 'instructeurs/procedures/synthese.html.haml',
|
|
all_dossiers_counts: {
|
|
'à suivre': 0,
|
|
'suivis': 0,
|
|
'traités': 1,
|
|
'dossiers': 1,
|
|
'archivés': 0
|
|
},
|
|
procedures: [procedure, procedure2]
|
|
}
|
|
|
|
it { is_expected.to have_text('Synthèse des dossiers') }
|
|
it { is_expected.to have_text('suivis') }
|
|
it { is_expected.to have_text('traités') }
|
|
it { is_expected.to have_text('dossiers') }
|
|
it { is_expected.to have_text('archivés') }
|
|
end
|
|
|
|
context 'when instructeur has 1 procedure and 1 file, table is not shown' do
|
|
subject {
|
|
render 'instructeurs/procedures/synthese.html.haml',
|
|
all_dossiers_counts: {
|
|
'à suivre': 0,
|
|
'suivis': 0,
|
|
'traités': 1,
|
|
'dossiers': 1,
|
|
'archivés': 0
|
|
},
|
|
procedures: [procedure]
|
|
}
|
|
|
|
it { is_expected.not_to have_text('Synthèse des dossiers') }
|
|
it { is_expected.not_to have_text('suivis') }
|
|
it { is_expected.not_to have_text('traités') }
|
|
it { is_expected.not_to have_text('dossiers') }
|
|
it { is_expected.not_to have_text('archivés') }
|
|
end
|
|
end
|