aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2006-09-28 19:32:40 +0000
committerJamis Buck <jamis@37signals.com>2006-09-28 19:32:40 +0000
commitc0eccc9aef21c3eac9d89d3af93b82ce906b04dd (patch)
treec2466fe2ed1814cfed136f7dc8e981733fbc7dc2 /actionpack/test
parentb2ede64a89a5837a047e75f21a1522324a614514 (diff)
downloadrails-c0eccc9aef21c3eac9d89d3af93b82ce906b04dd.tar.gz
rails-c0eccc9aef21c3eac9d89d3af93b82ce906b04dd.tar.bz2
rails-c0eccc9aef21c3eac9d89d3af93b82ce906b04dd.zip
modify head so that you can specify a bare status code as the first parameter
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5200 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/new_render_test.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb
index 5463df3c60..b2b40b7636 100644
--- a/actionpack/test/controller/new_render_test.rb
+++ b/actionpack/test/controller/new_render_test.rb
@@ -222,6 +222,10 @@ class NewRenderTestController < ActionController::Base
head :x_custom_header => "something"
end
+ def head_with_status_code_first
+ head :forbidden, :x_custom_header => "something"
+ end
+
helper NewRenderTestHelper
helper do
def rjs_helper_method(value)
@@ -656,9 +660,16 @@ EOS
end
end
- def head_with_string_status
+ def test_head_with_string_status
get :head_with_string_status, :status => "404 Eat Dirt"
assert_equal 404, @response.response_code
assert_equal "Eat Dirt", @response.message
end
+
+ def test_head_with_status_code_first
+ get :head_with_status_code_first
+ assert_equal 403, @response.response_code
+ assert_equal "Forbidden", @response.message
+ assert_equal "something", @response.headers["X-Custom-Header"]
+ end
end