aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-07-10 11:29:13 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-07-10 14:19:10 -0700
commit314ac0cd572ff9618997f8fd61ed381985c3a9cb (patch)
tree61f7e722ea3fa0a053e471befde0c47d1f062be3 /actionpack
parentf1fcf9b526773cc6aa2564158900c55a722b1a2c (diff)
downloadrails-314ac0cd572ff9618997f8fd61ed381985c3a9cb.tar.gz
rails-314ac0cd572ff9618997f8fd61ed381985c3a9cb.tar.bz2
rails-314ac0cd572ff9618997f8fd61ed381985c3a9cb.zip
call the `path_parameters=` setter rather than rely on mutations
We should call the setter on `path_parameters` so that we know the hash will only contain the values that we've set.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/test_case.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb
index 3045b7f0c3..afd15b8630 100644
--- a/actionpack/lib/action_controller/test_case.rb
+++ b/actionpack/lib/action_controller/test_case.rb
@@ -46,6 +46,7 @@ module ActionController
parameters = parameters.symbolize_keys
extra_keys = routes.extra_keys(parameters.merge(:controller => controller_path, :action => action))
non_path_parameters = {}
+ path_parameters = {}
parameters.each do |key, value|
if extra_keys.include?(key) || key == :action || key == :controller
@@ -99,12 +100,13 @@ module ActionController
path_parameters[:controller] = controller_path
path_parameters[:action] = action
+ self.path_parameters = path_parameters
+
# Clear the combined params hash in case it was already referenced.
@env.delete("action_dispatch.request.parameters")
# Clear the filter cache variables so they're not stale
@filtered_parameters = @filtered_env = @filtered_path = nil
-
end
ENCODER = Class.new do