aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2010-01-15 12:35:18 -0600
committerJoshua Peek <josh@joshpeek.com>2010-01-15 12:38:50 -0600
commit3eaf525213ccef5c63c9e296fa643ad416a3f84c (patch)
treef7ab86f8622fc7ce1247377134195bf9eac2b2b0 /actionpack/test/controller
parent43a84a054f51f260e1d4a9d4be75783e497a3398 (diff)
downloadrails-3eaf525213ccef5c63c9e296fa643ad416a3f84c.tar.gz
rails-3eaf525213ccef5c63c9e296fa643ad416a3f84c.tar.bz2
rails-3eaf525213ccef5c63c9e296fa643ad416a3f84c.zip
Make HEAD method masquerade as GET so requests are routed correctly
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/integration_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb
index 624b14e69b..683ab5236c 100644
--- a/actionpack/test/controller/integration_test.rb
+++ b/actionpack/test/controller/integration_test.rb
@@ -254,6 +254,10 @@ class IntegrationProcessTest < ActionController::IntegrationTest
render :text => "Created", :status => 201
end
+ def method
+ render :text => "method: #{request.method}"
+ end
+
def cookie_monster
cookies["cookie_1"] = nil
cookies["cookie_3"] = "chocolate"
@@ -379,6 +383,14 @@ class IntegrationProcessTest < ActionController::IntegrationTest
head '/post'
assert_equal 201, status
assert_equal "", body
+
+ get '/get/method'
+ assert_equal 200, status
+ assert_equal "method: get", body
+
+ head '/get/method'
+ assert_equal 200, status
+ assert_equal "", body
end
end
@@ -391,6 +403,7 @@ class IntegrationProcessTest < ActionController::IntegrationTest
with_routing do |set|
set.draw do |map|
match ':action', :to => ::IntegrationProcessTest::IntegrationController
+ get 'get/:action', :to => ::IntegrationProcessTest::IntegrationController
end
yield
end