Skip to content

Commit 48febf3

Browse files
committed
Fix postgres timestamp type test
- now there are 2 types, timestamp and timestamptz
1 parent 68c7398 commit 48febf3

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

test/db/postgresql/native_types_test.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ def self.up
1919
"bigint_serial_should_be_integer bigint default nextval('seq_pk_customers')",
2020
"integer_serial_should_be_integer integer default nextval('seq_pk_customers')",
2121
"varchar_should_be_string varchar(2)",
22-
"timestamp_should_be_datetime timestamp",
22+
"timestamp_should_be_timestamp timestamp",
23+
"timestamptz_should_be_timestamptz timestamptz",
2324
"bytea_should_be_binary bytea",
2425
"double_precision_should_be_float double precision",
2526
"real_should_be_float real",
@@ -69,8 +70,14 @@ def test_varchar_should_be_mapped_to_string
6970
assert_instance_of ActiveModel::Type::String, column_type("varchar_should_be_string")
7071
end
7172

72-
def test_timestamp_should_be_mapped_to_datetime
73-
assert_instance_of OID::DateTime, column_type("timestamp_should_be_datetime")
73+
def test_timestamp_should_be_mapped_to_timestamp
74+
assert_kind_of OID::DateTime, column_type("timestamp_should_be_timestamp")
75+
assert_instance_of OID::Timestamp, column_type("timestamp_should_be_timestamp")
76+
end
77+
78+
def test_timestamptz_should_be_mapped_to_timestamptz
79+
assert_kind_of OID::DateTime, column_type("timestamptz_should_be_timestamptz")
80+
assert_instance_of OID::TimestampWithTimeZone, column_type("timestamptz_should_be_timestamptz")
7481
end
7582

7683
def test_bytea_should_be_mapped_to_binary

0 commit comments

Comments
 (0)