Skip to content

Commit 531bc9e

Browse files
committed
Pull in these quoted test cases from mysql adapter for pg
I found these cases were not covered in the pg adapter tests, but were explicitly in the mysql tests. Due to how quote treats Numeric specifically, I think more tests won't hurt.
1 parent 238e32a commit 531bc9e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

activerecord/test/cases/adapters/postgresql/quoting_test.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ def test_quote_float_infinity
2929
assert_equal "'Infinity'", @conn.quote(infinity)
3030
end
3131

32+
def test_cast_bound_integer
33+
assert_equal "42", @conn.quote(42)
34+
end
35+
36+
def test_cast_bound_big_decimal
37+
assert_equal "4.2", @conn.quote(BigDecimal("4.2"))
38+
end
39+
40+
def test_cast_bound_rational
41+
assert_equal "3/4", @conn.quote(Rational(3, 4))
42+
end
43+
3244
def test_quote_range
3345
range = "1,2]'; SELECT * FROM users; --".."a"
3446
type = OID::Range.new(Type::Integer.new, :int8range)

0 commit comments

Comments
 (0)