aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/request
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2017-01-18 16:09:58 +0900
committerAkira Matsuda <ronnie@dio.jp>2017-01-18 17:30:46 +0900
commit5349d4ee080ff6da892081eae871a195847353c1 (patch)
tree60c6ebacfc509551b8eadb5ed74a5f66791cd200 /actionpack/test/controller/request
parent044f8bdf625dae78e4e230b9c61d9881864e2def (diff)
downloadrails-5349d4ee080ff6da892081eae871a195847353c1.tar.gz
rails-5349d4ee080ff6da892081eae871a195847353c1.tar.bz2
rails-5349d4ee080ff6da892081eae871a195847353c1.zip
:warning: "Use assert_nil if expecting nil. This will fail in MT6."
These are followups for 307065f959f2b34bdad16487bae906eb3bfeaf28, but TBH I'm personally not very much confortable with this style. Maybe we could override assert_equal in our test_helper not to warn?
Diffstat (limited to 'actionpack/test/controller/request')
-rw-r--r--actionpack/test/controller/request/test_request_test.rb20
1 files changed, 12 insertions, 8 deletions
diff --git a/actionpack/test/controller/request/test_request_test.rb b/actionpack/test/controller/request/test_request_test.rb
index b67ae72c0a..1440db00f6 100644
--- a/actionpack/test/controller/request/test_request_test.rb
+++ b/actionpack/test/controller/request/test_request_test.rb
@@ -21,16 +21,20 @@ class ActionController::TestRequestTest < ActionController::TestCase
@request.get_header("CONTENT_LENGTH"))
end
- ActionDispatch::Session::AbstractStore::DEFAULT_OPTIONS.each_key do |option|
- test "rack default session options #{option} exists in session options and is default" do
- assert_equal(ActionDispatch::Session::AbstractStore::DEFAULT_OPTIONS[option],
- @request.session_options[option],
- "Missing rack session default option #{option} in request.session_options")
+ ActionDispatch::Session::AbstractStore::DEFAULT_OPTIONS.each_pair do |key, value|
+ test "rack default session options #{key} exists in session options and is default" do
+ if value.nil?
+ assert_nil(@request.session_options[key],
+ "Missing rack session default option #{key} in request.session_options")
+ else
+ assert_equal(value, @request.session_options[key],
+ "Missing rack session default option #{key} in request.session_options")
+ end
end
- test "rack default session options #{option} exists in session options" do
- assert(@request.session_options.has_key?(option),
- "Missing rack session option #{option} in request.session_options")
+ test "rack default session options #{key} exists in session options" do
+ assert(@request.session_options.has_key?(key),
+ "Missing rack session option #{key} in request.session_options")
end
end
end