diff options
author | Xavier Noria <fxn@hashref.com> | 2016-08-09 23:53:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-09 23:53:54 +0200 |
commit | 7b31b06d4afd73734ac54cbbac105f0eab8d0d43 (patch) | |
tree | 94789c1c7f3c8e1c611a30548cd90ecbb34f98ea /actionpack/test/controller/parameters/nested_parameters_permit_test.rb | |
parent | 67d0c9ee93100dbdcafd20b0632e5bef6735888e (diff) | |
parent | f006de5dc5a709f5dc8604ebd43f7741da30cd9f (diff) | |
download | rails-7b31b06d4afd73734ac54cbbac105f0eab8d0d43.tar.gz rails-7b31b06d4afd73734ac54cbbac105f0eab8d0d43.tar.bz2 rails-7b31b06d4afd73734ac54cbbac105f0eab8d0d43.zip |
Merge pull request #26095 from kamipo/fix_broken_alignment_by_auto_correct
Fix broken alignments caused by auto-correct commit 411ccbd
Diffstat (limited to 'actionpack/test/controller/parameters/nested_parameters_permit_test.rb')
-rw-r--r-- | actionpack/test/controller/parameters/nested_parameters_permit_test.rb | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/actionpack/test/controller/parameters/nested_parameters_permit_test.rb b/actionpack/test/controller/parameters/nested_parameters_permit_test.rb index e3f1ba5f0a..f0155477c4 100644 --- a/actionpack/test/controller/parameters/nested_parameters_permit_test.rb +++ b/actionpack/test/controller/parameters/nested_parameters_permit_test.rb @@ -7,7 +7,8 @@ class NestedParametersPermitTest < ActiveSupport::TestCase end test "permitted nested parameters" do - params = ActionController::Parameters.new( book: { + params = ActionController::Parameters.new( + book: { title: "Romeo and Juliet", authors: [{ name: "William Shakespeare", @@ -43,7 +44,8 @@ class NestedParametersPermitTest < ActiveSupport::TestCase end test "permitted nested parameters with a string or a symbol as a key" do - params = ActionController::Parameters.new( book: { + params = ActionController::Parameters.new( + book: { "authors" => [ { name: "William Shakespeare", born: "1564-04-26" }, { name: "Christopher Marlowe" } @@ -66,7 +68,8 @@ class NestedParametersPermitTest < ActiveSupport::TestCase end test "nested arrays with strings" do - params = ActionController::Parameters.new( book: { + params = ActionController::Parameters.new( + book: { genres: ["Tragedy"] }) @@ -75,7 +78,8 @@ class NestedParametersPermitTest < ActiveSupport::TestCase end test "permit may specify symbols or strings" do - params = ActionController::Parameters.new( book: { + params = ActionController::Parameters.new( + book: { title: "Romeo and Juliet", author: "William Shakespeare" }, @@ -88,7 +92,8 @@ class NestedParametersPermitTest < ActiveSupport::TestCase end test "nested array with strings that should be hashes" do - params = ActionController::Parameters.new( book: { + params = ActionController::Parameters.new( + book: { genres: ["Tragedy"] }) @@ -97,7 +102,8 @@ class NestedParametersPermitTest < ActiveSupport::TestCase end test "nested array with strings that should be hashes and additional values" do - params = ActionController::Parameters.new( book: { + params = ActionController::Parameters.new( + book: { title: "Romeo and Juliet", genres: ["Tragedy"] }) @@ -108,7 +114,8 @@ class NestedParametersPermitTest < ActiveSupport::TestCase end test "nested string that should be a hash" do - params = ActionController::Parameters.new( book: { + params = ActionController::Parameters.new( + book: { genre: "Tragedy" }) @@ -117,7 +124,8 @@ class NestedParametersPermitTest < ActiveSupport::TestCase end test "fields_for-style nested params" do - params = ActionController::Parameters.new( book: { + params = ActionController::Parameters.new( + book: { authors_attributes: { '0': { name: "William Shakespeare", age_of_death: "52" }, '1': { name: "Unattributed Assistant" }, @@ -136,7 +144,8 @@ class NestedParametersPermitTest < ActiveSupport::TestCase end test "fields_for-style nested params with negative numbers" do - params = ActionController::Parameters.new( book: { + params = ActionController::Parameters.new( + book: { authors_attributes: { '-1': { name: "William Shakespeare", age_of_death: "52" }, '-2': { name: "Unattributed Assistant" } @@ -153,7 +162,8 @@ class NestedParametersPermitTest < ActiveSupport::TestCase end test "nested number as key" do - params = ActionController::Parameters.new( product: { + params = ActionController::Parameters.new( + product: { properties: { "0" => "prop0", "1" => "prop1" |