From afb398b583b23c139c5a069c1281550bb69760e0 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Thu, 14 Nov 2019 06:53:05 +0900 Subject: [PATCH] Change to always returns html document in error pages (#12214) --- app/controllers/application_controller.rb | 5 +---- spec/controllers/application_controller_spec.rb | 5 ----- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index bd3d137743..e19d5b142f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -136,9 +136,6 @@ class ApplicationController < ActionController::Base end def respond_with_error(code) - respond_to do |format| - format.any { head code } - format.html { render "errors/#{code}", layout: 'error', status: code } - end + render "errors/#{code}", layout: 'error', status: code end end diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index da4a794cdd..63ae27a924 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -22,11 +22,6 @@ describe ApplicationController, type: :controller do end shared_examples 'respond_with_error' do |code| - it "returns http #{code} for any" do - subject - expect(response).to have_http_status(code) - end - it "returns http #{code} for http" do subject expect(response).to have_http_status(code)