Permalink
Browse files

Add failing test re #3436 which demonstrates content_type is not resp…

…ected when using the :head method/shortcut
  • Loading branch information...
1 parent 3ca28de commit c09a92fb9e08ee36d795a237899d3439930ef784 @whistlerbrk whistlerbrk committed May 7, 2012
Showing with 21 additions and 0 deletions.
  1. +21 −0 actionpack/test/controller/render_test.rb
View
21 actionpack/test/controller/render_test.rb
@@ -505,6 +505,14 @@ def render_content_type_from_body
render :text => "hello world!"
end
+ def head_created
+ head :created
+ end
+
+ def head_created_with_application_json_content_type
+ head :created, :content_type => "application/json"
+ end
+
def head_with_location_header
head :location => "/foo"
end
@@ -1177,6 +1185,19 @@ def test_overwritting_rendering_relative_file_with_extension
assert_equal "<html>\n <p>Hello</p>\n</html>\n", @response.body
end
+ def test_head_created
+ post :head_created
+ assert_blank @response.body
+ assert_response :created
+ end
+
+ def test_head_created_with_application_json_content_type
+ post :head_created_with_application_json_content_type
+ assert_blank @response.body
+ assert_equal "application/json", @response.content_type
+ assert_response :created
+ end
+
def test_head_with_location_header
get :head_with_location_header
assert_blank @response.body

0 comments on commit c09a92f

Please sign in to comment.