Remove unused code
This commit is contained in:
parent
388d8d6f01
commit
d0f0533a32
3 changed files with 0 additions and 57 deletions
|
@ -184,25 +184,6 @@ module Instructeurs
|
|||
redirect_back(fallback_location: instructeur_procedure_url(procedure))
|
||||
end
|
||||
|
||||
def download_dossiers
|
||||
dossiers = current_instructeur.dossiers.for_procedure(procedure)
|
||||
|
||||
respond_to do |format|
|
||||
format.csv do
|
||||
send_data(procedure.to_csv(dossiers),
|
||||
filename: procedure.export_filename(:csv))
|
||||
end
|
||||
format.xlsx do
|
||||
send_data(procedure.to_xlsx(dossiers),
|
||||
filename: procedure.export_filename(:xlsx))
|
||||
end
|
||||
format.ods do
|
||||
send_data(procedure.to_ods(dossiers),
|
||||
filename: procedure.export_filename(:ods))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def download_export
|
||||
export_format = params[:export_format]
|
||||
notice_message = "Nous générons cet export. Lorsque celui-ci sera disponible, vous recevrez une notification par email accompagnée d'un lien de téléchargement."
|
||||
|
|
|
@ -305,7 +305,6 @@ Rails.application.routes.draw do
|
|||
get 'update_sort/:table/:column' => 'procedures#update_sort', as: 'update_sort'
|
||||
post 'add_filter'
|
||||
get 'remove_filter' => 'procedures#remove_filter', as: 'remove_filter'
|
||||
get 'download_dossiers'
|
||||
get 'download_export'
|
||||
get 'stats'
|
||||
get 'email_notifications'
|
||||
|
|
|
@ -411,43 +411,6 @@ describe Instructeurs::ProceduresController, type: :controller do
|
|||
end
|
||||
end
|
||||
|
||||
describe "#download_dossiers" do
|
||||
let(:instructeur) { create(:instructeur) }
|
||||
let!(:procedure) { create(:procedure, instructeurs: [instructeur]) }
|
||||
let!(:gi_2) { procedure.groupe_instructeurs.create(label: '2') }
|
||||
let!(:dossier_1) { create(:dossier, procedure: procedure) }
|
||||
let!(:dossier_2) { create(:dossier, groupe_instructeur: gi_2) }
|
||||
|
||||
context "when logged in" do
|
||||
before do
|
||||
sign_in(instructeur.user)
|
||||
end
|
||||
|
||||
context "csv" do
|
||||
before do
|
||||
expect_any_instance_of(Procedure).to receive(:to_csv)
|
||||
.with(instructeur.dossiers.for_procedure(procedure))
|
||||
|
||||
get :download_dossiers, params: { procedure_id: procedure.id }, format: 'csv'
|
||||
end
|
||||
|
||||
it { expect(response).to have_http_status(:ok) }
|
||||
end
|
||||
|
||||
context "xlsx" do
|
||||
before { get :download_dossiers, params: { procedure_id: procedure.id }, format: 'xlsx' }
|
||||
|
||||
it { expect(response).to have_http_status(:ok) }
|
||||
end
|
||||
|
||||
context "ods" do
|
||||
before { get :download_dossiers, params: { procedure_id: procedure.id }, format: 'ods' }
|
||||
|
||||
it { expect(response).to have_http_status(:ok) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#update_email_notifications' do
|
||||
let(:instructeur) { create(:instructeur) }
|
||||
let!(:procedure) { create(:procedure, instructeurs: [instructeur]) }
|
||||
|
|
Loading…
Reference in a new issue