From c09a92fb9e08ee36d795a237899d3439930ef784 Mon Sep 17 00:00:00 2001 From: Kunal Shah Date: Mon, 7 May 2012 15:23:06 -0400 Subject: Add failing test re #3436 which demonstrates content_type is not respected when using the :head method/shortcut --- actionpack/test/controller/render_test.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'actionpack/test/controller/render_test.rb') diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 5e699c0daf..3d58c02338 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -505,6 +505,14 @@ class TestController < ActionController::Base 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 @@ class RenderTest < ActionController::TestCase assert_equal "\n

Hello

\n\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 -- cgit v1.2.3