aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-12-19 20:51:16 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-12-20 14:04:49 -0600
commit8cb7bc8b55e8054f66cd58840392e6cc63134a90 (patch)
tree6a7626ebc1d23b21df71d46131666748fe9d3b21 /activerecord/test/cases/adapters
parent635080f33cdcbfb5a8dd85830eaef85f1555d93c (diff)
downloadrails-8cb7bc8b55e8054f66cd58840392e6cc63134a90.tar.gz
rails-8cb7bc8b55e8054f66cd58840392e6cc63134a90.tar.bz2
rails-8cb7bc8b55e8054f66cd58840392e6cc63134a90.zip
pg columns should understand the hstore type
Diffstat (limited to 'activerecord/test/cases/adapters')
-rw-r--r--activerecord/test/cases/adapters/postgresql/hstore_test.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/hstore_test.rb b/activerecord/test/cases/adapters/postgresql/hstore_test.rb
new file mode 100644
index 0000000000..155c6f593b
--- /dev/null
+++ b/activerecord/test/cases/adapters/postgresql/hstore_test.rb
@@ -0,0 +1,24 @@
+require "cases/helper"
+
+class PostgresqlHstoreTest < ActiveRecord::TestCase
+ class Hstore < ActiveRecord::Base
+ self.table_name = 'hstores'
+ end
+
+ def setup
+ @connection = ActiveRecord::Base.connection
+ @connection.create_table('hstores') do |t|
+ t.hstore 'tags'
+ end
+ end
+
+ def teardown
+ @connection.execute 'drop table if exists hstores'
+ end
+
+ def test_column
+ column = Hstore.columns.find { |c| c.name == 'tags' }
+ assert column
+ assert_equal :hstore, column.type
+ end
+end