1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

test that dates / times / datetimes call quoted_date

This commit is contained in:
Aaron Patterson 2010-10-12 11:21:35 -07:00
parent 8b33f66891
commit 1ba3489b75

View file

@ -134,6 +134,16 @@ module ActiveRecord
assert_equal bigdec.to_s('F'), @quoter.quote(bigdec, nil)
assert_equal bigdec.to_s('F'), @quoter.quote(bigdec, Object.new)
end
def test_dates_and_times
@quoter.extend(Module.new { def quoted_date(value) 'lol' end })
assert_equal "'lol'", @quoter.quote(Date.today, nil)
assert_equal "'lol'", @quoter.quote(Date.today, Object.new)
assert_equal "'lol'", @quoter.quote(Time.now, nil)
assert_equal "'lol'", @quoter.quote(Time.now, Object.new)
assert_equal "'lol'", @quoter.quote(DateTime.now, nil)
assert_equal "'lol'", @quoter.quote(DateTime.now, Object.new)
end
end
end
end