]> cat aescling's git repositories - mastodon.git/commitdiff
Change to always returns html document in error pages (#12214)
authorYamagishi Kazutoshi <ykzts@desire.sh>
Wed, 13 Nov 2019 21:53:05 +0000 (06:53 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 13 Nov 2019 21:53:05 +0000 (22:53 +0100)
app/controllers/application_controller.rb
spec/controllers/application_controller_spec.rb

index bd3d137743f89339f8d7629a634a093435094c8e..e19d5b142f9b158cd45a954f83fc3a12773ca3d4 100644 (file)
@@ -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
index da4a794cddc30d94adcdbc8c200e2cf01173987b..63ae27a924ef98ec1120676cbec9a1affec43d9c 100644 (file)
@@ -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)