aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/render_test.rb
diff options
context:
space:
mode:
authorKunal Shah <me@kunalashah.com>2012-05-07 15:23:06 -0400
committerKunal Shah <me@kunalashah.com>2012-05-08 03:11:46 -0400
commitc09a92fb9e08ee36d795a237899d3439930ef784 (patch)
tree880ef8d0ade5b0ec39ff0cf04057758ab77df8a4 /actionpack/test/controller/render_test.rb
parent3ca28dec0f5a4c41816f187dc31a922be5ebff89 (diff)
downloadrails-c09a92fb9e08ee36d795a237899d3439930ef784.tar.gz
rails-c09a92fb9e08ee36d795a237899d3439930ef784.tar.bz2
rails-c09a92fb9e08ee36d795a237899d3439930ef784.zip
Add failing test re #3436 which demonstrates content_type is not respected when using the :head method/shortcut
Diffstat (limited to 'actionpack/test/controller/render_test.rb')
-rw-r--r--actionpack/test/controller/render_test.rb21
1 files changed, 21 insertions, 0 deletions
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 "<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