diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2016-12-31 19:32:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-31 19:32:59 +0100 |
commit | ac0b28883b78999c5605d032eb42fcd842841e6b (patch) | |
tree | 3f71fbd48b2d9ffba17564d6330fc5c33f76bd94 /activerecord/test/cases | |
parent | 1e3d6482ccf2fb885957419eff0c237a8aeccf13 (diff) | |
parent | b43d0173972e732331a718a34e062b50260968d9 (diff) | |
download | rails-ac0b28883b78999c5605d032eb42fcd842841e6b.tar.gz rails-ac0b28883b78999c5605d032eb42fcd842841e6b.tar.bz2 rails-ac0b28883b78999c5605d032eb42fcd842841e6b.zip |
Merge pull request #27527 from kamipo/array_subtype_options
Dump array subtype options correctly
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/array_test.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/array_test.rb b/activerecord/test/cases/adapters/postgresql/array_test.rb index 680dad9706..982a91782f 100644 --- a/activerecord/test/cases/adapters/postgresql/array_test.rb +++ b/activerecord/test/cases/adapters/postgresql/array_test.rb @@ -16,10 +16,11 @@ class PostgresqlArrayTest < ActiveRecord::PostgreSQLTestCase @connection.transaction do @connection.create_table("pg_arrays") do |t| - t.string "tags", array: true + t.string "tags", array: true, limit: 255 t.integer "ratings", array: true t.datetime :datetimes, array: true t.hstore :hstores, array: true + t.decimal :decimals, array: true, default: [], precision: 10, scale: 2 end end PgArray.reset_column_information @@ -34,7 +35,7 @@ class PostgresqlArrayTest < ActiveRecord::PostgreSQLTestCase def test_column assert_equal :string, @column.type - assert_equal "character varying", @column.sql_type + assert_equal "character varying(255)", @column.sql_type assert @column.array? assert_not @type.binary? @@ -110,8 +111,9 @@ class PostgresqlArrayTest < ActiveRecord::PostgreSQLTestCase def test_schema_dump_with_shorthand output = dump_table_schema "pg_arrays" - assert_match %r[t\.string\s+"tags",\s+array: true], output + assert_match %r[t\.string\s+"tags",\s+limit: 255,\s+array: true], output assert_match %r[t\.integer\s+"ratings",\s+array: true], output + assert_match %r[t\.decimal\s+"decimals",\s+precision: 10,\s+scale: 2,\s+default: \[\],\s+array: true], output end def test_select_with_strings |