aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/metal/strong_parameters.rb6
-rw-r--r--actionpack/test/controller/api/renderers_test.rb4
-rw-r--r--actionpack/test/controller/parameters/accessors_test.rb6
3 files changed, 14 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb
index e9aa0aae37..ba03430930 100644
--- a/actionpack/lib/action_controller/metal/strong_parameters.rb
+++ b/actionpack/lib/action_controller/metal/strong_parameters.rb
@@ -160,7 +160,11 @@ module ActionController
if other_hash.respond_to?(:permitted?)
super
else
- @parameters == other_hash
+ if other_hash.is_a?(Hash)
+ @parameters == other_hash.with_indifferent_access
+ else
+ @parameters == other_hash
+ end
end
end
diff --git a/actionpack/test/controller/api/renderers_test.rb b/actionpack/test/controller/api/renderers_test.rb
index a1307d6f82..911a8144b2 100644
--- a/actionpack/test/controller/api/renderers_test.rb
+++ b/actionpack/test/controller/api/renderers_test.rb
@@ -51,7 +51,9 @@ class RenderersApiTest < ActionController::TestCase
end
def test_render_text
- get :text
+ assert_deprecated do
+ get :text
+ end
assert_response :internal_server_error
assert_equal('Hi from text', @response.body)
end
diff --git a/actionpack/test/controller/parameters/accessors_test.rb b/actionpack/test/controller/parameters/accessors_test.rb
index a8f4d877a6..bd43ff7697 100644
--- a/actionpack/test/controller/parameters/accessors_test.rb
+++ b/actionpack/test/controller/parameters/accessors_test.rb
@@ -128,4 +128,10 @@ class ParametersAccessorsTest < ActiveSupport::TestCase
assert_not @params.values_at(:person).first.permitted?
assert_not @params[:person].values_at(:name).first.permitted?
end
+
+ test "equality with another hash works" do
+ hash1 = { foo: :bar }
+ params1 = ActionController::Parameters.new(hash1)
+ assert(params1 == hash1)
+ end
end