diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2016-08-02 16:22:57 +0200 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2016-08-02 16:22:57 +0200 |
commit | 1d542e47d15d0f29cf301dcb883143716c06552c (patch) | |
tree | 6ad8f4a6c8163a18bd845bd015cc1ceea328ba08 /actionpack/test | |
parent | b71732c84a4bb5f8f7cbf65c5193db97c7e31eca (diff) | |
download | rails-1d542e47d15d0f29cf301dcb883143716c06552c.tar.gz rails-1d542e47d15d0f29cf301dcb883143716c06552c.tar.bz2 rails-1d542e47d15d0f29cf301dcb883143716c06552c.zip |
Set `always_permitted_parameters`.
The tests were written with the common false value seen in Rails apps,
show that intent in the code.
Should also fix the build on 5-0-stable.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/parameters/serialization_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/controller/parameters/serialization_test.rb b/actionpack/test/controller/parameters/serialization_test.rb index 84193e304a..352dd8ffb7 100644 --- a/actionpack/test/controller/parameters/serialization_test.rb +++ b/actionpack/test/controller/parameters/serialization_test.rb @@ -3,6 +3,15 @@ require 'action_controller/metal/strong_parameters' 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 + end + + teardown do + ActionController::Parameters.always_permitted_parameters = @old_permitted_parameters + end + test 'yaml serialization' do assert_equal <<-end_of_yaml.strip_heredoc, YAML.dump(ActionController::Parameters.new(key: :value)) --- !ruby/object:ActionController::Parameters |