demarches-normaliennes/spec/views/instructeur/procedures/_download_dossiers.html.haml_spec.rb
2019-08-12 13:47:01 +02:00

20 lines
821 B
Ruby

describe 'instructeurs/procedures/_download_dossiers.html.haml', type: :view do
let(:current_instructeur) { create(:instructeur) }
let(:procedure) { create(:procedure) }
subject { render 'instructeurs/procedures/download_dossiers.html.haml', procedure: procedure }
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
let!(:dossier) { create(:dossier, :en_construction, procedure: procedure) }
it { is_expected.to include("Télécharger tous les dossiers") }
end
end