demarches-normaliennes/spec/views/instructeur/procedures/_download_dossiers.html.haml_spec.rb

27 lines
1 KiB
Ruby
Raw Normal View History

describe 'instructeurs/procedures/_download_dossiers.html.haml', type: :view do
let(:current_instructeur) { create(:instructeur) }
let(:procedure) { create(:procedure) }
2021-04-22 08:38:34 +02:00
let(:dossier_count) { 0 }
2021-06-16 11:46:25 +02:00
subject { render 'instructeurs/procedures/download_dossiers.html.haml', procedure: procedure, dossier_count: dossier_count, exports: {} }
context "when procedure has 0 dossier" do
it { is_expected.not_to include("Télécharger tous les dossiers") }
end
2021-04-22 08:38:34 +02:00
context "when procedure has at least 1 dossier" do
let(:dossier_count) { 1 }
it { is_expected.to include("Télécharger tous les dossiers") }
context "With zip archive enabled" do
before { Flipper.enable(:archive_zip_globale, procedure) }
it { is_expected.to include("Télécharger une archive au format .zip") }
end
context "With zip archive disabled" do
before { Flipper.disable(:archive_zip_globale, procedure) }
it { is_expected.not_to include("Télécharger une archive au format .zip") }
end
end
end