aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2018-07-31 15:54:23 -0400
committerGitHub <noreply@github.com>2018-07-31 15:54:23 -0400
commitb66bf91316d6726be359331bcaf436df66a9d257 (patch)
tree53d6d50ec577a9c32c5d41f2abfc9730d7a843ef /actionpack/test
parent40ac706393568109d32f6c72f79fc09d22936e77 (diff)
parentf4b57b904dd4b6f6b4db6ff397cab23463890cc0 (diff)
downloadrails-b66bf91316d6726be359331bcaf436df66a9d257.tar.gz
rails-b66bf91316d6726be359331bcaf436df66a9d257.tar.bz2
rails-b66bf91316d6726be359331bcaf436df66a9d257.zip
Merge pull request #28937 from maclover7/jm-fix-28927
Default content type for `head` is `text/html`
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/render_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index 6e3bd0596b..306b245bd1 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -250,6 +250,15 @@ class TestController < ActionController::Base
head 204
end
+ def head_default_content_type
+ # simulating path like "/1.foobar"
+ request.formats = []
+
+ respond_to do |format|
+ format.any { head 200 }
+ end
+ end
+
private
def set_variable_for_layout
@@ -814,6 +823,11 @@ class HeadRenderTest < ActionController::TestCase
get :head_and_return
end
end
+
+ def test_head_default_content_type
+ post :head_default_content_type
+ assert_equal "text/html", @response.header["Content-Type"]
+ end
end
class HttpCacheForeverTest < ActionController::TestCase