Skip to content

Commit

Permalink
Add failing test re rails#3436 which demonstrates content_type is not…
Browse files Browse the repository at this point in the history
… respected when using the :head method/shortcut
  • Loading branch information
kshahkshah committed May 8, 2012
1 parent 3ca28de commit c09a92f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions actionpack/test/controller/render_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c09a92f

Please sign in to comment.