Skip to content

Commit

Permalink
Change to always returns html document in error pages (#12214)
Browse files Browse the repository at this point in the history
  • Loading branch information
ykzts authored and Gargron committed Nov 13, 2019
1 parent 6c60cce commit afb398b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
5 changes: 1 addition & 4 deletions app/controllers/application_controller.rb
Expand Up @@ -136,9 +136,6 @@ def current_theme
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
5 changes: 0 additions & 5 deletions spec/controllers/application_controller_spec.rb
Expand Up @@ -22,11 +22,6 @@ def invalid_authenticity_token
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)
Expand Down

0 comments on commit afb398b

Please sign in to comment.