aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-12-20 13:56:42 -0600
committerAaron Patterson <aaron.patterson@gmail.com>2011-12-20 14:04:51 -0600
commit66d8620e3c1dcc6df5c8c648085d833ff7bdd2ff (patch)
treefb847e4f3dd4f9613bab536b1cd5253a27d755f9 /activerecord/test/cases/adapters/postgresql
parent8daaff5dac0725c5cf62811ac4a67b21f62aca2f (diff)
downloadrails-66d8620e3c1dcc6df5c8c648085d833ff7bdd2ff.tar.gz
rails-66d8620e3c1dcc6df5c8c648085d833ff7bdd2ff.tar.bz2
rails-66d8620e3c1dcc6df5c8c648085d833ff7bdd2ff.zip
making sure updates work
Diffstat (limited to 'activerecord/test/cases/adapters/postgresql')
-rw-r--r--activerecord/test/cases/adapters/postgresql/hstore_test.rb20
1 files changed, 13 insertions, 7 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/hstore_test.rb b/activerecord/test/cases/adapters/postgresql/hstore_test.rb
index e03c938a25..b350094cc7 100644
--- a/activerecord/test/cases/adapters/postgresql/hstore_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/hstore_test.rb
@@ -45,33 +45,39 @@ class PostgresqlHstoreTest < ActiveRecord::TestCase
end
def test_create
- assert_cycle_hstore('a' => 'b', '1' => '2')
+ assert_cycle('a' => 'b', '1' => '2')
end
def test_quotes
- assert_cycle_hstore('a' => 'b"ar', '1"foo' => '2')
+ assert_cycle('a' => 'b"ar', '1"foo' => '2')
end
def test_whitespace
- assert_cycle_hstore('a b' => 'b ar', '1"foo' => '2')
+ assert_cycle('a b' => 'b ar', '1"foo' => '2')
end
def test_backslash
- assert_cycle_hstore('a\\b' => 'b\\ar', '1"foo' => '2')
+ assert_cycle('a\\b' => 'b\\ar', '1"foo' => '2')
end
def test_comma
- assert_cycle_hstore('a, b' => 'bar', '1"foo' => '2')
+ assert_cycle('a, b' => 'bar', '1"foo' => '2')
end
def test_arrow
- assert_cycle_hstore('a=>b' => 'bar', '1"foo' => '2')
+ assert_cycle('a=>b' => 'bar', '1"foo' => '2')
end
private
- def assert_cycle_hstore hash
+ def assert_cycle hash
x = Hstore.create!(:tags => hash)
x.reload
assert_equal(hash, x.tags)
+
+ # make sure updates work
+ x.tags = hash
+ x.save!
+ x.reload
+ assert_equal(hash, x.tags)
end
end