aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-11-07 21:45:10 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-11-07 21:45:10 +0000
commit57313c54bfc3a47f32507cb466df91b5a9688db7 (patch)
tree5a363701bafb47693c451134e47438c4e60adfb4 /actionpack/test
parentad06514257e4472a986577ba7df66d9b8db8a2c2 (diff)
downloadrails-57313c54bfc3a47f32507cb466df91b5a9688db7.tar.gz
rails-57313c54bfc3a47f32507cb466df91b5a9688db7.tar.bz2
rails-57313c54bfc3a47f32507cb466df91b5a9688db7.zip
assert_response supports symbolic status codes. Closes #6569.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5466 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/new_render_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb
index 729119d9fb..16709b4ea6 100644
--- a/actionpack/test/controller/new_render_test.rb
+++ b/actionpack/test/controller/new_render_test.rb
@@ -640,24 +640,29 @@ EOS
get :head_with_location_header
assert @response.body.blank?
assert_equal "/foo", @response.headers["Location"]
+ assert_response :ok
end
def test_head_with_custom_header
get :head_with_custom_header
assert @response.body.blank?
assert_equal "something", @response.headers["X-Custom-Header"]
+ assert_response :ok
end
def test_head_with_symbolic_status
get :head_with_symbolic_status, :status => "ok"
assert_equal "200 OK", @response.headers["Status"]
+ assert_response :ok
get :head_with_symbolic_status, :status => "not_found"
assert_equal "404 Not Found", @response.headers["Status"]
+ assert_response :not_found
ActionController::StatusCodes::SYMBOL_TO_STATUS_CODE.each do |status, code|
get :head_with_symbolic_status, :status => status.to_s
assert_equal code, @response.response_code
+ assert_response status
end
end
@@ -672,6 +677,7 @@ EOS
get :head_with_string_status, :status => "404 Eat Dirt"
assert_equal 404, @response.response_code
assert_equal "Eat Dirt", @response.message
+ assert_response :not_found
end
def test_head_with_status_code_first
@@ -679,5 +685,6 @@ EOS
assert_equal 403, @response.response_code
assert_equal "Forbidden", @response.message
assert_equal "something", @response.headers["X-Custom-Header"]
+ assert_response :forbidden
end
end