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:
parent
8b33f66891
commit
1ba3489b75
1 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue