From 273045d6d5c5f68e38f917e8ab4b1ad533d23aac Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 21 Dec 2013 14:22:08 +0100 Subject: optimizes array conversion in AC::Parameters --- actionpack/test/controller/parameters/parameters_permit_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actionpack/test/controller/parameters') diff --git a/actionpack/test/controller/parameters/parameters_permit_test.rb b/actionpack/test/controller/parameters/parameters_permit_test.rb index ba191a7227..9c1828e9aa 100644 --- a/actionpack/test/controller/parameters/parameters_permit_test.rb +++ b/actionpack/test/controller/parameters/parameters_permit_test.rb @@ -160,6 +160,11 @@ class ParametersPermitTest < ActiveSupport::TestCase end end + test 'arrays are converted at most once' do + params = ActionController::Parameters.new(foo: [{}]) + assert params[:foo].equal?(params[:foo]) + end + test "fetch doesnt raise ParameterMissing exception if there is a default" do assert_equal "monkey", @params.fetch(:foo, "monkey") assert_equal "monkey", @params.fetch(:foo) { "monkey" } -- cgit v1.2.3