From 57313c54bfc3a47f32507cb466df91b5a9688db7 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 7 Nov 2006 21:45:10 +0000 Subject: assert_response supports symbolic status codes. Closes #6569. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5466 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/new_render_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'actionpack/test') 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 -- cgit v1.2.3