diff options
author | José Valim <jose.valim@gmail.com> | 2010-09-27 21:00:54 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-27 21:00:54 +0200 |
commit | fe0251e408a8b5d1ee149c7cad7bcfc495ce1595 (patch) | |
tree | 620f92c8485809ded3cd4081966d147efc8ad806 /actionpack/test/dispatch | |
parent | 6067d1620075c1c311bbae01993453cd80967804 (diff) | |
parent | 50decfbc0e2e58961cc3665710922860d38ee2fb (diff) | |
download | rails-fe0251e408a8b5d1ee149c7cad7bcfc495ce1595.tar.gz rails-fe0251e408a8b5d1ee149c7cad7bcfc495ce1595.tar.bz2 rails-fe0251e408a8b5d1ee149c7cad7bcfc495ce1595.zip |
Merge remote branch 'miloops/warnings'
Conflicts:
actionpack/lib/action_controller/metal/url_for.rb
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/cookies_test.rb | 10 | ||||
-rw-r--r-- | actionpack/test/dispatch/request_test.rb | 6 | ||||
-rw-r--r-- | actionpack/test/dispatch/response_test.rb | 16 | ||||
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 8 | ||||
-rw-r--r-- | actionpack/test/dispatch/session/cookie_store_test.rb | 2 | ||||
-rw-r--r-- | actionpack/test/dispatch/show_exceptions_test.rb | 14 |
6 files changed, 24 insertions, 32 deletions
diff --git a/actionpack/test/dispatch/cookies_test.rb b/actionpack/test/dispatch/cookies_test.rb index 360fb351df..efdc1f5d93 100644 --- a/actionpack/test/dispatch/cookies_test.rb +++ b/actionpack/test/dispatch/cookies_test.rb @@ -47,7 +47,7 @@ class CookiesTest < ActionController::TestCase cookies["user_name"] = { :value => "david", :httponly => true } head :ok end - + def authenticate_with_secure cookies["user_name"] = { :value => "david", :secure => true } head :ok @@ -133,7 +133,7 @@ class CookiesTest < ActionController::TestCase assert_cookie_header "user_name=david; path=/; HttpOnly" assert_equal({"user_name" => "david"}, @response.cookies) end - + def test_setting_cookie_with_secure get :authenticate_with_secure assert_cookie_header "user_name=david; path=/; secure" @@ -169,8 +169,8 @@ class CookiesTest < ActionController::TestCase def test_permanent_cookie get :set_permanent_cookie - assert_match /Jamie/, @response.headers["Set-Cookie"] - assert_match %r(#{20.years.from_now.utc.year}), @response.headers["Set-Cookie"] + assert_match(/Jamie/, @response.headers["Set-Cookie"]) + assert_match(%r(#{20.years.from_now.utc.year}), @response.headers["Set-Cookie"]) end def test_signed_cookie @@ -185,7 +185,7 @@ class CookiesTest < ActionController::TestCase def test_permanent_signed_cookie get :set_permanent_signed_cookie - assert_match %r(#{20.years.from_now.utc.year}), @response.headers["Set-Cookie"] + assert_match(%r(#{20.years.from_now.utc.year}), @response.headers["Set-Cookie"]) assert_equal 100, @controller.send(:cookies).signed[:remember_me] end diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb index a8b8f9377b..a53d4f1edd 100644 --- a/actionpack/test/dispatch/request_test.rb +++ b/actionpack/test/dispatch/request_test.rb @@ -45,9 +45,9 @@ class RequestTest < ActiveSupport::TestCase e = assert_raise(ActionDispatch::RemoteIp::IpSpoofAttackError) { request.remote_ip } - assert_match /IP spoofing attack/, e.message - assert_match /HTTP_X_FORWARDED_FOR="1.1.1.1"/, e.message - assert_match /HTTP_CLIENT_IP="2.2.2.2"/, e.message + assert_match(/IP spoofing attack/, e.message) + assert_match(/HTTP_X_FORWARDED_FOR="1.1.1.1"/, e.message) + assert_match(/HTTP_CLIENT_IP="2.2.2.2"/, e.message) # turn IP Spoofing detection off. # This is useful for sites that are aimed at non-IP clients. The typical diff --git a/actionpack/test/dispatch/response_test.rb b/actionpack/test/dispatch/response_test.rb index c20fa10f63..1efb664304 100644 --- a/actionpack/test/dispatch/response_test.rb +++ b/actionpack/test/dispatch/response_test.rb @@ -120,10 +120,10 @@ class ResponseTest < ActiveSupport::TestCase end test "read cache control" do - resp = ActionDispatch::Response.new.tap { |resp| - resp.cache_control[:public] = true - resp.etag = '123' - resp.body = 'Hello' + resp = ActionDispatch::Response.new.tap { |_resp| + _resp.cache_control[:public] = true + _resp.etag = '123' + _resp.body = 'Hello' } resp.to_a @@ -135,10 +135,10 @@ class ResponseTest < ActiveSupport::TestCase end test "read charset and content type" do - resp = ActionDispatch::Response.new.tap { |resp| - resp.charset = 'utf-16' - resp.content_type = Mime::XML - resp.body = 'Hello' + resp = ActionDispatch::Response.new.tap { |_resp| + _resp.charset = 'utf-16' + _resp.content_type = Mime::XML + _resp.body = 'Hello' } resp.to_a diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index bdef04efc6..53b13501b2 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -1216,14 +1216,6 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end end - def test_index - with_test_routes do - assert_equal '/info', info_path - get '/info' - assert_equal 'projects#info', @response.body - end - end - def test_match_shorthand_with_no_scope with_test_routes do assert_equal '/account/overview', account_overview_path diff --git a/actionpack/test/dispatch/session/cookie_store_test.rb b/actionpack/test/dispatch/session/cookie_store_test.rb index b436fb5518..3489f628ed 100644 --- a/actionpack/test/dispatch/session/cookie_store_test.rb +++ b/actionpack/test/dispatch/session/cookie_store_test.rb @@ -279,7 +279,7 @@ class CookieStoreTest < ActionDispatch::IntegrationTest def test_session_store_with_explicit_domain with_test_route_set(:domain => "example.es") do get '/set_session_value' - assert_match /domain=example\.es/, headers['Set-Cookie'] + assert_match(/domain=example\.es/, headers['Set-Cookie']) headers['Set-Cookie'] end end diff --git a/actionpack/test/dispatch/show_exceptions_test.rb b/actionpack/test/dispatch/show_exceptions_test.rb index 5b181600e8..4ede1ab47c 100644 --- a/actionpack/test/dispatch/show_exceptions_test.rb +++ b/actionpack/test/dispatch/show_exceptions_test.rb @@ -58,15 +58,15 @@ class ShowExceptionsTest < ActionDispatch::IntegrationTest get "/", {}, {'action_dispatch.show_exceptions' => true} assert_response 500 - assert_match /puke/, body + assert_match(/puke/, body) get "/not_found", {}, {'action_dispatch.show_exceptions' => true} assert_response 404 - assert_match /#{ActionController::UnknownAction.name}/, body + assert_match(/#{ActionController::UnknownAction.name}/, body) get "/method_not_allowed", {}, {'action_dispatch.show_exceptions' => true} assert_response 405 - assert_match /ActionController::MethodNotAllowed/, body + assert_match(/ActionController::MethodNotAllowed/, body) end end @@ -96,15 +96,15 @@ class ShowExceptionsTest < ActionDispatch::IntegrationTest get "/", {}, {'action_dispatch.show_exceptions' => true} assert_response 500 - assert_match /puke/, body + assert_match(/puke/, body) get "/not_found", {}, {'action_dispatch.show_exceptions' => true} assert_response 404 - assert_match /#{ActionController::UnknownAction.name}/, body + assert_match(/#{ActionController::UnknownAction.name}/, body) get "/method_not_allowed", {}, {'action_dispatch.show_exceptions' => true} assert_response 405 - assert_match /ActionController::MethodNotAllowed/, body + assert_match(/ActionController::MethodNotAllowed/, body) end test "does not show filtered parameters" do @@ -113,6 +113,6 @@ class ShowExceptionsTest < ActionDispatch::IntegrationTest get "/", {"foo"=>"bar"}, {'action_dispatch.show_exceptions' => true, 'action_dispatch.parameter_filter' => [:foo]} assert_response 500 - assert_match ""foo"=>"[FILTERED]"", body + assert_match(""foo"=>"[FILTERED]"", body) end end |