diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-08-10 06:36:39 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2016-08-10 06:36:39 +0900 |
commit | f006de5dc5a709f5dc8604ebd43f7741da30cd9f (patch) | |
tree | 94789c1c7f3c8e1c611a30548cd90ecbb34f98ea /actionpack/test/controller/parameters | |
parent | 67d0c9ee93100dbdcafd20b0632e5bef6735888e (diff) | |
download | rails-f006de5dc5a709f5dc8604ebd43f7741da30cd9f.tar.gz rails-f006de5dc5a709f5dc8604ebd43f7741da30cd9f.tar.bz2 rails-f006de5dc5a709f5dc8604ebd43f7741da30cd9f.zip |
Fix broken alignments caused by auto-correct commit 411ccbd
Hash syntax auto-correcting breaks alignments. 411ccbdab2608c62aabdb320d52cb02d446bb39c
Diffstat (limited to 'actionpack/test/controller/parameters')
5 files changed, 36 insertions, 18 deletions
diff --git a/actionpack/test/controller/parameters/always_permitted_parameters_test.rb b/actionpack/test/controller/parameters/always_permitted_parameters_test.rb index 9c9749c037..cd7c98f112 100644 --- a/actionpack/test/controller/parameters/always_permitted_parameters_test.rb +++ b/actionpack/test/controller/parameters/always_permitted_parameters_test.rb @@ -19,7 +19,8 @@ class AlwaysPermittedParametersTest < ActiveSupport::TestCase end test "permits parameters that are whitelisted" do - params = ActionController::Parameters.new( book: { pages: 65 }, + params = ActionController::Parameters.new( + book: { pages: 65 }, format: "json") permitted = params.permit book: [:pages] assert permitted.permitted? diff --git a/actionpack/test/controller/parameters/log_on_unpermitted_params_test.rb b/actionpack/test/controller/parameters/log_on_unpermitted_params_test.rb index bf2c3d1ed2..0358fd9976 100644 --- a/actionpack/test/controller/parameters/log_on_unpermitted_params_test.rb +++ b/actionpack/test/controller/parameters/log_on_unpermitted_params_test.rb @@ -11,7 +11,8 @@ class LogOnUnpermittedParamsTest < ActiveSupport::TestCase end test "logs on unexpected param" do - params = ActionController::Parameters.new( book: { pages: 65 }, + params = ActionController::Parameters.new( + book: { pages: 65 }, fishing: "Turnips") assert_logged("Unpermitted parameter: fishing") do @@ -20,7 +21,8 @@ class LogOnUnpermittedParamsTest < ActiveSupport::TestCase end test "logs on unexpected params" do - params = ActionController::Parameters.new( book: { pages: 65 }, + params = ActionController::Parameters.new( + book: { pages: 65 }, fishing: "Turnips", car: "Mersedes") @@ -30,7 +32,8 @@ class LogOnUnpermittedParamsTest < ActiveSupport::TestCase end test "logs on unexpected nested param" do - params = ActionController::Parameters.new( book: { pages: 65, title: "Green Cats and where to find then." }) + params = ActionController::Parameters.new( + book: { pages: 65, title: "Green Cats and where to find then." }) assert_logged("Unpermitted parameter: title") do params.permit(book: [:pages]) @@ -38,7 +41,8 @@ class LogOnUnpermittedParamsTest < ActiveSupport::TestCase end test "logs on unexpected nested params" do - params = ActionController::Parameters.new( book: { pages: 65, title: "Green Cats and where to find then.", author: "G. A. Dog" }) + params = ActionController::Parameters.new( + book: { pages: 65, title: "Green Cats and where to find then.", author: "G. A. Dog" }) assert_logged("Unpermitted parameters: title, author") do params.permit(book: [:pages]) diff --git a/actionpack/test/controller/parameters/multi_parameter_attributes_test.rb b/actionpack/test/controller/parameters/multi_parameter_attributes_test.rb index 44e39135a2..88fb477c10 100644 --- a/actionpack/test/controller/parameters/multi_parameter_attributes_test.rb +++ b/actionpack/test/controller/parameters/multi_parameter_attributes_test.rb @@ -3,7 +3,8 @@ require "action_controller/metal/strong_parameters" class MultiParameterAttributesTest < ActiveSupport::TestCase test "permitted multi-parameter attribute keys" do - params = ActionController::Parameters.new( book: { + params = ActionController::Parameters.new( + book: { "shipped_at(1i)" => "2012", "shipped_at(2i)" => "3", "shipped_at(3i)" => "25", 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" diff --git a/actionpack/test/controller/parameters/raise_on_unpermitted_params_test.rb b/actionpack/test/controller/parameters/raise_on_unpermitted_params_test.rb index bcb16eaf89..8fab7b28e9 100644 --- a/actionpack/test/controller/parameters/raise_on_unpermitted_params_test.rb +++ b/actionpack/test/controller/parameters/raise_on_unpermitted_params_test.rb @@ -11,7 +11,8 @@ class RaiseOnUnpermittedParamsTest < ActiveSupport::TestCase end test "raises on unexpected params" do - params = ActionController::Parameters.new( book: { pages: 65 }, + params = ActionController::Parameters.new( + book: { pages: 65 }, fishing: "Turnips") assert_raises(ActionController::UnpermittedParameters) do @@ -20,7 +21,8 @@ class RaiseOnUnpermittedParamsTest < ActiveSupport::TestCase end test "raises on unexpected nested params" do - params = ActionController::Parameters.new( book: { pages: 65, title: "Green Cats and where to find then." }) + params = ActionController::Parameters.new( + book: { pages: 65, title: "Green Cats and where to find then." }) assert_raises(ActionController::UnpermittedParameters) do params.permit(book: [:pages]) |