aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2016-03-08 16:09:59 +0100
committerYves Senn <yves.senn@gmail.com>2016-03-08 16:09:59 +0100
commit8b68ab6088a754dcacd77c7503b3c25b860edce2 (patch)
tree0561d1c37770d0053968a73db45514fefd9de20e
parent818a715dd3d305bf860263011d2313a3e041413c (diff)
downloadrails-8b68ab6088a754dcacd77c7503b3c25b860edce2.tar.gz
rails-8b68ab6088a754dcacd77c7503b3c25b860edce2.tar.bz2
rails-8b68ab6088a754dcacd77c7503b3c25b860edce2.zip
add test case for schema dumping of PG bytea columns.
-rw-r--r--activerecord/test/cases/adapters/postgresql/bytea_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/bytea_test.rb b/activerecord/test/cases/adapters/postgresql/bytea_test.rb
index b6bb1929e6..7adc070430 100644
--- a/activerecord/test/cases/adapters/postgresql/bytea_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/bytea_test.rb
@@ -1,6 +1,9 @@
require "cases/helper"
+require 'support/schema_dumping_helper'
class PostgresqlByteaTest < ActiveRecord::PostgreSQLTestCase
+ include SchemaDumpingHelper
+
class ByteaDataType < ActiveRecord::Base
self.table_name = 'bytea_data_type'
end
@@ -122,4 +125,10 @@ class PostgresqlByteaTest < ActiveRecord::PostgreSQLTestCase
obj.reload
assert_equal "hello world", obj.serialized
end
+
+ def test_schema_dumping
+ output = dump_table_schema("bytea_data_type")
+ assert_match %r{t\.binary\s+"payload"$}, output
+ assert_match %r{t\.binary\s+"serialized"$}, output
+ end
end