aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorJoel <joel@renewfund.com>2012-02-05 20:36:22 -0800
committerJoel <joel@renewfund.com>2012-02-08 22:28:51 -0800
commitb04880cecc6fdc452aeea5d64d078d90dfa2693a (patch)
tree68eabc3c1ecb354b0058879446d6b265d824747a /activerecord/test
parent2967aecdafb821bafc67745c75f4e95bcc273a49 (diff)
downloadrails-b04880cecc6fdc452aeea5d64d078d90dfa2693a.tar.gz
rails-b04880cecc6fdc452aeea5d64d078d90dfa2693a.tar.bz2
rails-b04880cecc6fdc452aeea5d64d078d90dfa2693a.zip
string_to_hstore / hstore_to_string, serializing
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/adapters/postgresql/hstore_test.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/hstore_test.rb b/activerecord/test/cases/adapters/postgresql/hstore_test.rb
index 28b5a50126..82c52b38a3 100644
--- a/activerecord/test/cases/adapters/postgresql/hstore_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/hstore_test.rb
@@ -12,7 +12,7 @@ class PostgresqlHstoreTest < ActiveRecord::TestCase
begin
@connection.transaction do
@connection.create_table('hstores') do |t|
- t.hstore 'tags'
+ t.hstore 'tags', :default => ''
end
end
rescue ActiveRecord::StatementInvalid
@@ -33,7 +33,7 @@ class PostgresqlHstoreTest < ActiveRecord::TestCase
assert @column
data = "\"1\"=>\"2\""
- hash = @column.class.cast_hstore data
+ hash = @column.class.string_to_hstore data
assert_equal({'1' => '2'}, hash)
assert_equal({'1' => '2'}, @column.type_cast(data))
@@ -43,19 +43,19 @@ class PostgresqlHstoreTest < ActiveRecord::TestCase
end
def test_gen1
- assert_equal(%q(" "=>""), @column.type_cast({' '=>''}))
+ assert_equal(%q(" "=>""), @column.class.hstore_to_string({' '=>''}))
end
def test_gen2
- assert_equal(%q(","=>""), @column.type_cast({','=>''}))
+ assert_equal(%q(","=>""), @column.class.hstore_to_string({','=>''}))
end
def test_gen3
- assert_equal(%q("="=>""), @column.type_cast({'='=>''}))
+ assert_equal(%q("="=>""), @column.class.hstore_to_string({'='=>''}))
end
def test_gen4
- assert_equal(%q(">"=>""), @column.type_cast({'>'=>''}))
+ assert_equal(%q(">"=>""), @column.class.hstore_to_string({'>'=>''}))
end
def test_parse1