diff options
author | Mehmet Emin İNAÇ <mehmetemininac@gmail.com> | 2015-05-28 15:13:32 +0300 |
---|---|---|
committer | Mehmet Emin İNAÇ <mehmetemininac@gmail.com> | 2015-05-28 15:13:32 +0300 |
commit | 44781b6e9790d90b4f8b9a41d2b2c114b1a582ee (patch) | |
tree | aa55b3f69aee623a1088398f2bbb1f4b191f20a4 /actionpack/test | |
parent | 7cc9754209c0ae00d70bdd629fa4a81a1c74cc6f (diff) | |
download | rails-44781b6e9790d90b4f8b9a41d2b2c114b1a582ee.tar.gz rails-44781b6e9790d90b4f8b9a41d2b2c114b1a582ee.tar.bz2 rails-44781b6e9790d90b4f8b9a41d2b2c114b1a582ee.zip |
Deprecate `:nothing` option for render method
`head` method works similar to `render` method with `:nothing` option
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/abstract_unit.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/action_pack_assertions_test.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/base_test.rb | 4 | ||||
-rw-r--r-- | actionpack/test/controller/flash_test.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/log_subscriber_test.rb | 4 | ||||
-rw-r--r-- | actionpack/test/controller/render_test.rb | 10 | ||||
-rw-r--r-- | actionpack/test/controller/request_forgery_protection_test.rb | 6 | ||||
-rw-r--r-- | actionpack/test/controller/test_case_test.rb | 6 |
8 files changed, 23 insertions, 13 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index c1be2c9afe..1690bdd542 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -380,7 +380,7 @@ module RoutingTestHelpers end class ResourcesController < ActionController::Base - def index() render :nothing => true end + def index() head :ok end alias_method :show, :index end diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb index 21586e2193..cbf333c772 100644 --- a/actionpack/test/controller/action_pack_assertions_test.rb +++ b/actionpack/test/controller/action_pack_assertions_test.rb @@ -123,7 +123,7 @@ end module Admin class InnerModuleController < ActionController::Base def index - render :nothing => true + head :ok end def redirect_to_index diff --git a/actionpack/test/controller/base_test.rb b/actionpack/test/controller/base_test.rb index f7ad8e5158..3240185414 100644 --- a/actionpack/test/controller/base_test.rb +++ b/actionpack/test/controller/base_test.rb @@ -13,7 +13,7 @@ end class NonEmptyController < ActionController::Base def public_action - render :nothing => true + head :ok end end @@ -29,7 +29,7 @@ end class OptionalDefaultUrlOptionsController < ActionController::Base def show - render nothing: true + head :ok end def default_url_options diff --git a/actionpack/test/controller/flash_test.rb b/actionpack/test/controller/flash_test.rb index 0ff0a1ef61..60a000c160 100644 --- a/actionpack/test/controller/flash_test.rb +++ b/actionpack/test/controller/flash_test.rb @@ -57,7 +57,7 @@ class FlashTest < ActionController::TestCase def std_action @flash_copy = {}.update(flash) - render :nothing => true + head :ok end def filter_halting_action diff --git a/actionpack/test/controller/log_subscriber_test.rb b/actionpack/test/controller/log_subscriber_test.rb index 03a4ad7823..4ae1b20d43 100644 --- a/actionpack/test/controller/log_subscriber_test.rb +++ b/actionpack/test/controller/log_subscriber_test.rb @@ -19,7 +19,7 @@ module Another end def show - render :nothing => true + head :ok end def redirector @@ -170,7 +170,7 @@ class ACLogSubscriberTest < ActionController::TestCase def test_process_action_with_view_runtime get :show wait - assert_match(/\(Views: [\d.]+ms\)/, logs[1]) + assert_match /Completed 200 OK in [\d]ms/, logs[1] end def test_append_info_to_payload_is_called_even_with_exception diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 79e2104789..cabacad940 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -120,6 +120,10 @@ class TestController < ActionController::Base render :action => 'hello_world' end + def respond_with_empty_body + render nothing: true + end + def conditional_hello_with_bangs render :action => 'hello_world' end @@ -270,6 +274,12 @@ class ExpiresInRenderTest < ActionController::TestCase assert_match(/no-transform/, @response.headers["Cache-Control"]) end + def test_render_nothing_deprecated + assert_deprecated do + get :respond_with_empty_body + end + end + def test_date_header_when_expires_in time = Time.mktime(2011,10,30) Time.stubs(:now).returns(time) diff --git a/actionpack/test/controller/request_forgery_protection_test.rb b/actionpack/test/controller/request_forgery_protection_test.rb index f8cf79a257..82c808754c 100644 --- a/actionpack/test/controller/request_forgery_protection_test.rb +++ b/actionpack/test/controller/request_forgery_protection_test.rb @@ -72,17 +72,17 @@ class RequestForgeryProtectionControllerUsingNullSession < ActionController::Bas def signed cookies.signed[:foo] = 'bar' - render :nothing => true + head :ok end def encrypted cookies.encrypted[:foo] = 'bar' - render :nothing => true + head :ok end def try_to_reset_session reset_session - render :nothing => true + head :ok end end diff --git a/actionpack/test/controller/test_case_test.rb b/actionpack/test/controller/test_case_test.rb index 37f27c5d36..fbfc891d19 100644 --- a/actionpack/test/controller/test_case_test.rb +++ b/actionpack/test/controller/test_case_test.rb @@ -137,13 +137,13 @@ XML def delete_cookie cookies.delete("foo") - render nothing: true + head :ok end def test_assigns @foo = "foo" @foo_hash = { foo: :bar } - render nothing: true + head :ok end def test_without_body @@ -177,7 +177,7 @@ XML class ViewAssignsController < ActionController::Base def test_assigns @foo = "foo" - render nothing: true + head :ok end def view_assigns |