From 25a61f0ca4e27658dcfa074a74e69cbf802aa6ba Mon Sep 17 00:00:00 2001 From: Max Schwenk Date: Sat, 13 Jan 2018 11:57:08 -0800 Subject: [PATCH 1/2] Fix Rails 6 assert_nil deprecations --- test/action_controller_test.rb | 2 +- test/destroy_session_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/action_controller_test.rb b/test/action_controller_test.rb index fdef00d..6289069 100644 --- a/test/action_controller_test.rb +++ b/test/action_controller_test.rb @@ -187,7 +187,7 @@ def test_doesnt_write_session_cookie_if_session_id_is_already_exists get '/get_session_value' assert_response :success - assert_equal nil, headers['Set-Cookie'], "should not resend the cookie again if session_id cookie is already exists" + assert_nil headers['Set-Cookie'], "should not resend the cookie again if session_id cookie is already exists" end end diff --git a/test/destroy_session_test.rb b/test/destroy_session_test.rb index 0fdf5a8..c3b299c 100644 --- a/test/destroy_session_test.rb +++ b/test/destroy_session_test.rb @@ -27,7 +27,7 @@ def test_destroy_without_renew s.destroy renewed_session_model = req.env[record_key] - assert_equal nil, renewed_session_model.data['rails'] + assert_nil renewed_session_model.data['rails'] end def test_destroy_with_renew From 554c1663843ca63f034126d28f7507d990310d2d Mon Sep 17 00:00:00 2001 From: Max Schwenk Date: Sat, 13 Jan 2018 11:57:27 -0800 Subject: [PATCH 2/2] Fix Rails 6 dynamic actions deprecations --- test/helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/helper.rb b/test/helper.rb index 7014db0..6af2dcc 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -38,10 +38,11 @@ def self.build_app(routes = nil) def with_test_route_set(options = {}) controller_namespace = self.class.to_s.underscore + actions = %w[set_session_value get_session_value call_reset_session renew get_session_id] with_routing do |set| set.draw do - get ':action', :controller => "#{controller_namespace}/test" + actions.each { |action| get action, controller: "#{controller_namespace}/test" } end @app = self.class.build_app(set) do |middleware|