aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-02-01 01:01:49 -0600
committerJoshua Peek <josh@joshpeek.com>2009-02-01 01:01:49 -0600
commit5b5d0e325d9b031638c0cebb128f2acc3dd764c4 (patch)
treee28e19927699eb1d9d0e35a4cbdf8dd9e927eb81 /actionpack/test/controller
parent63b4fe53abec586e122cde629adde5000a517f9c (diff)
downloadrails-5b5d0e325d9b031638c0cebb128f2acc3dd764c4.tar.gz
rails-5b5d0e325d9b031638c0cebb128f2acc3dd764c4.tar.bz2
rails-5b5d0e325d9b031638c0cebb128f2acc3dd764c4.zip
Use Rack::Head middleware to ensure the body is discarded for HEAD requests
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/integration_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb
index 4f07cbee47..dc2c6fae49 100644
--- a/actionpack/test/controller/integration_test.rb
+++ b/actionpack/test/controller/integration_test.rb
@@ -266,6 +266,7 @@ class IntegrationProcessTest < ActionController::IntegrationTest
assert_response :success
assert_response :ok
assert_equal({}, cookies)
+ assert_equal "OK", body
assert_equal "OK", response.body
assert_kind_of HTML::Document, html_document
assert_equal 1, request_count
@@ -281,6 +282,7 @@ class IntegrationProcessTest < ActionController::IntegrationTest
assert_response :success
assert_response :created
assert_equal({}, cookies)
+ assert_equal "Created", body
assert_equal "Created", response.body
assert_kind_of HTML::Document, html_document
assert_equal 1, request_count
@@ -360,6 +362,18 @@ class IntegrationProcessTest < ActionController::IntegrationTest
end
end
+ def test_head
+ with_test_route_set do
+ head '/get'
+ assert_equal 200, status
+ assert_equal "", body
+
+ head '/post'
+ assert_equal 201, status
+ assert_equal "", body
+ end
+ end
+
private
def with_test_route_set
with_routing do |set|