aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/datatype_test_postgresql.rb
diff options
context:
space:
mode:
authorTarmo Tänav <tarmo@itech.ee>2008-05-26 01:28:56 +0300
committerPratik Naik <pratiknaik@gmail.com>2008-05-26 00:45:42 +0100
commitc5d37c0662a65ce9723d668f57b59457e79ee5ca (patch)
tree61c6aba0f774509405b22b41912593f2c1a0e489 /activerecord/test/cases/datatype_test_postgresql.rb
parentf88267d532ecbfebb66b95863a4875b65507ddf3 (diff)
downloadrails-c5d37c0662a65ce9723d668f57b59457e79ee5ca.tar.gz
rails-c5d37c0662a65ce9723d668f57b59457e79ee5ca.tar.bz2
rails-c5d37c0662a65ce9723d668f57b59457e79ee5ca.zip
Fix tests for postgres 8.3.x
Made test_with_limiting_with_custom_select not dependent on database default order. Fixed tests with non-US monetary locale. The monetary type is fixed precision so it should not expect the database to return a float. Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/test/cases/datatype_test_postgresql.rb')
-rw-r--r--activerecord/test/cases/datatype_test_postgresql.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/test/cases/datatype_test_postgresql.rb b/activerecord/test/cases/datatype_test_postgresql.rb
index 41726ce518..bff092b5d7 100644
--- a/activerecord/test/cases/datatype_test_postgresql.rb
+++ b/activerecord/test/cases/datatype_test_postgresql.rb
@@ -30,8 +30,8 @@ class PostgresqlDataTypeTest < ActiveRecord::TestCase
@connection.execute("INSERT INTO postgresql_arrays (commission_by_quarter, nicknames) VALUES ( '{35000,21000,18000,17000}', '{foo,bar,baz}' )")
@first_array = PostgresqlArray.find(1)
- @connection.execute("INSERT INTO postgresql_moneys (wealth) VALUES ('$567.89')")
- @connection.execute("INSERT INTO postgresql_moneys (wealth) VALUES ('-$567.89')")
+ @connection.execute("INSERT INTO postgresql_moneys (wealth) VALUES ('567.89'::money)")
+ @connection.execute("INSERT INTO postgresql_moneys (wealth) VALUES ('-567.89'::money)")
@first_money = PostgresqlMoney.find(1)
@second_money = PostgresqlMoney.find(2)
@@ -143,11 +143,11 @@ class PostgresqlDataTypeTest < ActiveRecord::TestCase
end
def test_update_money
- new_value = 123.45
+ new_value = BigDecimal.new('123.45')
assert @first_money.wealth = new_value
assert @first_money.save
assert @first_money.reload
- assert_equal @first_money.wealth, new_value
+ assert_equal new_value, @first_money.wealth
end
def test_update_number