Explorar el Código

Change to always returns html document in error pages (#12214)

master^2
Yamagishi Kazutoshi hace 4 años
committed by Eugen Rochko
padre
commit
afb398b583
Se han modificado 2 ficheros con 1 adiciones y 9 borrados
  1. +1
    -4
      app/controllers/application_controller.rb
  2. +0
    -5
      spec/controllers/application_controller_spec.rb

+ 1
- 4
app/controllers/application_controller.rb Ver fichero

@@ -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

+ 0
- 5
spec/controllers/application_controller_spec.rb Ver fichero

@@ -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)


Cargando…
Cancelar
Guardar