2020-05-27 11:25:43 +02:00
|
|
|
describe 'shared/_procedure_description.html.haml', type: :view do
|
|
|
|
let(:procedure) { create(:procedure, :published, :with_service) }
|
|
|
|
|
|
|
|
subject { render partial: 'shared/procedure_description', locals: { procedure: procedure } }
|
|
|
|
|
|
|
|
it 'renders the view' do
|
|
|
|
subject
|
|
|
|
expect(rendered).to have_selector('.procedure-logos')
|
|
|
|
expect(rendered).to have_text(procedure.libelle)
|
|
|
|
expect(rendered).to have_text(procedure.description)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not show empty date limite' do
|
|
|
|
subject
|
|
|
|
expect(rendered).not_to have_text('Date limite')
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when the procedure has an auto_archive date' do
|
|
|
|
let(:procedure) { create(:procedure, :published, :with_service, :with_auto_archive) }
|
|
|
|
it 'shows the auto_archive_on' do
|
|
|
|
subject
|
|
|
|
expect(rendered).to have_text('Date limite')
|
|
|
|
end
|
|
|
|
end
|
2022-05-24 11:39:03 +02:00
|
|
|
|
|
|
|
context 'when the procedure_estimated_fill_duration feature is enabled' do
|
|
|
|
before { Flipper.enable(:procedure_estimated_fill_duration) }
|
|
|
|
after { Flipper.disable(:procedure_estimated_fill_duration) }
|
|
|
|
|
|
|
|
it { is_expected.to have_text('Temps de remplissage estimé') }
|
|
|
|
end
|
2020-05-27 11:25:43 +02:00
|
|
|
end
|