aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/CHANGELOG.md4
-rw-r--r--actionpack/lib/action_dispatch/request/session.rb4
-rw-r--r--actionpack/test/dispatch/system_testing/server_test.rb6
3 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md
index 9835733b17..76342f7108 100644
--- a/actionpack/CHANGELOG.md
+++ b/actionpack/CHANGELOG.md
@@ -1,3 +1,7 @@
+* Add method `dig` to `session`.
+
+ *claudiob*, *Takumi Shotoku*
+
* Controller level `force_ssl` has been deprecated in favor of
`config.force_ssl`.
diff --git a/actionpack/lib/action_dispatch/request/session.rb b/actionpack/lib/action_dispatch/request/session.rb
index 2ff651fc31..bc5e0670e0 100644
--- a/actionpack/lib/action_dispatch/request/session.rb
+++ b/actionpack/lib/action_dispatch/request/session.rb
@@ -93,8 +93,8 @@ module ActionDispatch
@delegate[key.to_s]
end
- # Returns the nested value specified by the sequence of key, returning
- # nil if any intermediate step is nil.
+ # Returns the nested value specified by the sequence of keys, returning
+ # +nil+ if any intermediate step is +nil+.
def dig(*keys)
load_for_read!
keys = keys.map.with_index { |key, i| i.zero? ? key.to_s : key }
diff --git a/actionpack/test/dispatch/system_testing/server_test.rb b/actionpack/test/dispatch/system_testing/server_test.rb
index 740e90a4da..33d2f6a645 100644
--- a/actionpack/test/dispatch/system_testing/server_test.rb
+++ b/actionpack/test/dispatch/system_testing/server_test.rb
@@ -5,10 +5,6 @@ require "capybara/dsl"
require "action_dispatch/system_testing/server"
class ServerTest < ActiveSupport::TestCase
- setup do
- @old_capybara_server = Capybara.server
- end
-
test "port is always included" do
ActionDispatch::SystemTesting::Server.new.run
assert Capybara.always_include_port, "expected Capybara.always_include_port to be true"
@@ -27,6 +23,6 @@ class ServerTest < ActiveSupport::TestCase
end
teardown do
- Capybara.server = @old_capybara_server
+ Capybara.server = :default
end
end