d8a8d1fdab
feat(expiration_banner): enhance wording of expiration feat(dossiers/expiration_banner): enhance wording regarding expiration to include duree_conservation_dossiers_dans_ds + extension_conservation, also add spec on expiration_banner for instructeur
33 lines
1.3 KiB
Ruby
33 lines
1.3 KiB
Ruby
describe 'instructeurs/procedures/_header.html.haml', type: :view do
|
|
let(:procedure) { create(:procedure, id: 1, procedure_expires_when_termine_enabled: expiration_enabled) }
|
|
|
|
before { allow(view).to receive(:current_instructeur).and_return(create(:instructeur)) }
|
|
|
|
subject do
|
|
render('instructeurs/procedures/header.html.haml',
|
|
procedure: procedure,
|
|
statut: 'tous',
|
|
a_suivre_count: 0,
|
|
suivis_count: 0,
|
|
traites_count: 0,
|
|
tous_count: 0,
|
|
archives_count: 0,
|
|
expirant_count: 0,
|
|
has_en_cours_notifications: false,
|
|
has_termine_notifications: false)
|
|
end
|
|
|
|
context 'when procedure_expires_when_termine_enabled is true' do
|
|
let(:expiration_enabled) { true }
|
|
it 'contains link to expiring dossiers within procedure' do
|
|
expect(subject).to have_selector(%Q(a[href="#{instructeur_procedure_path(procedure, statut: 'expirant')}"]), count: 1)
|
|
end
|
|
end
|
|
|
|
context 'when procedure_expires_when_termine_enabled is false' do
|
|
let(:expiration_enabled) { false }
|
|
it 'does not contain link to expiring dossiers within procedure' do
|
|
expect(subject).to have_selector(%Q(a[href="#{instructeur_procedure_path(procedure, statut: 'expirant')}"]), count: 0)
|
|
end
|
|
end
|
|
end
|