1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix wrong assignment.

Screwed up both the left and right hand sides!
This commit is contained in:
Kasper Timm Hansen 2016-08-02 16:52:18 +02:00
parent 1d542e47d1
commit 70b995a77f

View file

@ -4,16 +4,17 @@ require 'active_support/core_ext/string/strip'
class ParametersSerializationTest < ActiveSupport::TestCase
setup do
@old_permitted_parameters = ActionController::Parameters.always_permitted_parameters
ActionController::Parameters.always_permitted_parameters = true
@old_permitted_parameters = ActionController::Parameters.permit_all_parameters
ActionController::Parameters.permit_all_parameters = false
end
teardown do
ActionController::Parameters.always_permitted_parameters = @old_permitted_parameters
ActionController::Parameters.permit_all_parameters = @old_permitted_parameters
end
test 'yaml serialization' do
assert_equal <<-end_of_yaml.strip_heredoc, YAML.dump(ActionController::Parameters.new(key: :value))
params = ActionController::Parameters.new(key: :value)
assert_equal <<-end_of_yaml.strip_heredoc, YAML.dump(params)
--- !ruby/object:ActionController::Parameters
parameters: !ruby/hash:ActiveSupport::HashWithIndifferentAccess
key: :value