From 7ccae2c4f1a4335030239b0417c46ac6e8af700b Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Wed, 24 Jan 2018 14:44:28 +0100 Subject: [PATCH] render nothing: true has been removed from Rails Use head instead --- app/controllers/ping_controller.rb | 4 ++-- spec/controllers/new_gestionnaire/dossiers_controller_spec.rb | 2 +- spec/controllers/new_user/dossiers_controller_spec.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/ping_controller.rb b/app/controllers/ping_controller.rb index 5848f722c..f8697379b 100644 --- a/app/controllers/ping_controller.rb +++ b/app/controllers/ping_controller.rb @@ -2,9 +2,9 @@ class PingController < ApplicationController def index Rails.logger.silence do if (ActiveRecord::Base.connected?) - render nothing: true, status: 200, content_type: "application/json" + head :ok else - render nothing: true, status: 500, content_type: "application/json" + head :internal_server_error end end end diff --git a/spec/controllers/new_gestionnaire/dossiers_controller_spec.rb b/spec/controllers/new_gestionnaire/dossiers_controller_spec.rb index 26deeb93c..ab9a861fa 100644 --- a/spec/controllers/new_gestionnaire/dossiers_controller_spec.rb +++ b/spec/controllers/new_gestionnaire/dossiers_controller_spec.rb @@ -21,7 +21,7 @@ describe NewGestionnaire::DossiersController, type: :controller do expect(controller).to receive(:send_data) .with('pdf content', filename: 'attestation.pdf', type: 'application/pdf') do - controller.render nothing: true + controller.head :ok end get :attestation, params: { procedure_id: procedure.id, dossier_id: dossier.id } diff --git a/spec/controllers/new_user/dossiers_controller_spec.rb b/spec/controllers/new_user/dossiers_controller_spec.rb index e3807bcb8..358a893c2 100644 --- a/spec/controllers/new_user/dossiers_controller_spec.rb +++ b/spec/controllers/new_user/dossiers_controller_spec.rb @@ -56,7 +56,7 @@ describe NewUser::DossiersController, type: :controller do expect(controller).to receive(:send_data) .with('pdf content', filename: 'attestation.pdf', type: 'application/pdf') do - controller.render nothing: true + controller.head :ok end get :attestation, params: { dossier_id: dossier.id }