2019-03-25 16:54:46 +01:00
|
|
|
describe 'gestionnaires/procedures/_download_dossiers.html.haml', type: :view do
|
2017-11-28 10:24:36 +01:00
|
|
|
let(:current_gestionnaire) { create(:gestionnaire) }
|
|
|
|
let(:procedure) { create(:procedure) }
|
|
|
|
|
2019-03-25 16:54:46 +01:00
|
|
|
subject { render 'gestionnaires/procedures/download_dossiers.html.haml', procedure: procedure }
|
2017-11-28 10:24:36 +01:00
|
|
|
|
|
|
|
context "when procedure has 0 dossier" do
|
|
|
|
it { is_expected.not_to include("Télécharger tous les dossiers") }
|
|
|
|
end
|
|
|
|
|
|
|
|
context "when procedure has 1 dossier brouillon" do
|
|
|
|
let!(:dossier) { create(:dossier, procedure: procedure) }
|
|
|
|
it { is_expected.not_to include("Télécharger tous les dossiers") }
|
|
|
|
end
|
|
|
|
|
|
|
|
context "when procedure has at least 1 dossier en construction" do
|
2017-12-14 15:51:45 +01:00
|
|
|
let!(:dossier) { create(:dossier, :en_construction, procedure: procedure) }
|
2017-11-28 10:24:36 +01:00
|
|
|
it { is_expected.to include("Télécharger tous les dossiers") }
|
|
|
|
end
|
|
|
|
end
|