diff options
author | Charles Oliver Nutter <headius@headius.com> | 2016-10-21 15:57:35 -0500 |
---|---|---|
committer | Charles Oliver Nutter <headius@headius.com> | 2016-10-21 16:27:06 -0500 |
commit | fe09e7bd7155e8ff9ae58671a4a3508d52d54712 (patch) | |
tree | c942f8f397ac85f20f382f40404dd3f5d33e4a61 /actionpack | |
parent | e16a5fb508bf7833d7f7a9429ccd3b20990b7d4b (diff) | |
download | rails-fe09e7bd7155e8ff9ae58671a4a3508d52d54712.tar.gz rails-fe09e7bd7155e8ff9ae58671a4a3508d52d54712.tar.bz2 rails-fe09e7bd7155e8ff9ae58671a4a3508d52d54712.zip |
Soften this test since YAML.dump may produce keys in other orders.
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/test/controller/parameters/serialization_test.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/actionpack/test/controller/parameters/serialization_test.rb b/actionpack/test/controller/parameters/serialization_test.rb index 4fb1564c68..6fba2fde91 100644 --- a/actionpack/test/controller/parameters/serialization_test.rb +++ b/actionpack/test/controller/parameters/serialization_test.rb @@ -14,12 +14,10 @@ class ParametersSerializationTest < ActiveSupport::TestCase test "yaml serialization" do 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 - permitted: false - end_of_yaml + yaml_dump = YAML.dump(params) + assert_match("--- !ruby/object:ActionController::Parameters", yaml_dump) + assert_match(/parameters: !ruby\/hash:ActiveSupport::HashWithIndifferentAccess\n\s+key: :value/, yaml_dump) + assert_match("permitted: false", yaml_dump) end test "yaml deserialization" do |