export all demarches

This commit is contained in:
Christophe Robillard 2022-11-25 19:55:59 +01:00
parent cea92c0488
commit 3a660349ad
3 changed files with 29 additions and 2 deletions

View file

@ -95,6 +95,16 @@ describe Administrateurs::ProceduresController, type: :controller do
it { expect(subject.status).to eq(200) }
context 'for export' do
subject { get :all, format: :xlsx }
it 'exports result in xlsx' do
allow(SpreadsheetArchitect).to receive(:to_xlsx)
subject
expect(SpreadsheetArchitect).to have_received(:to_xlsx)
end
end
it 'display published or closed procedures' do
subject
expect(values_for_field(assigns(:procedures), "id")).to include(published_procedure.id)