diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2016-06-29 11:08:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-29 11:08:51 -0400 |
commit | 3055f59e0ad7d5f0eee24c22a45fbae4a40b056e (patch) | |
tree | b3d5ecd69d01c45351d6f6046e047c2484013256 /activerecord/test/cases/adapters | |
parent | 160cc331796ebfbcd6da83e96f391ab5732832b6 (diff) | |
parent | a023fd665701cd455d9458e1b1a0cd0e550202aa (diff) | |
download | rails-3055f59e0ad7d5f0eee24c22a45fbae4a40b056e.tar.gz rails-3055f59e0ad7d5f0eee24c22a45fbae4a40b056e.tar.bz2 rails-3055f59e0ad7d5f0eee24c22a45fbae4a40b056e.zip |
Merge pull request #25559 from kmcphillips/master
Do not inspect array of over 10 elements
Diffstat (limited to 'activerecord/test/cases/adapters')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/array_test.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/array_test.rb b/activerecord/test/cases/adapters/postgresql/array_test.rb index 380a90d765..70792e937c 100644 --- a/activerecord/test/cases/adapters/postgresql/array_test.rb +++ b/activerecord/test/cases/adapters/postgresql/array_test.rb @@ -189,8 +189,13 @@ class PostgresqlArrayTest < ActiveRecord::PostgreSQLTestCase end def test_attribute_for_inspect_for_array_field + record = PgArray.new { |a| a.ratings = (1..10).to_a } + assert_equal("[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", record.attribute_for_inspect(:ratings)) + end + + def test_attribute_for_inspect_for_array_field_for_large_array record = PgArray.new { |a| a.ratings = (1..11).to_a } - assert_equal("[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...]", record.attribute_for_inspect(:ratings)) + assert_equal("[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]", record.attribute_for_inspect(:ratings)) end def test_escaping |