diff options
| author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-12 11:21:35 -0700 | 
|---|---|---|
| committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-12 11:21:35 -0700 | 
| commit | 1ba3489b7528dd562393bbc9997d3e39f7b74f6b (patch) | |
| tree | 321c54357c3342a9e53df14677a3ce44257fef2e | |
| parent | 8b33f6689193eec2160d253033d0002dcce6d83a (diff) | |
| download | rails-1ba3489b7528dd562393bbc9997d3e39f7b74f6b.tar.gz rails-1ba3489b7528dd562393bbc9997d3e39f7b74f6b.tar.bz2 rails-1ba3489b7528dd562393bbc9997d3e39f7b74f6b.zip | |
test that dates / times / datetimes call quoted_date
| -rw-r--r-- | activerecord/test/cases/quoting_test.rb | 10 | 
1 files changed, 10 insertions, 0 deletions
| diff --git a/activerecord/test/cases/quoting_test.rb b/activerecord/test/cases/quoting_test.rb index cb34db1c7e..ded03cd61b 100644 --- a/activerecord/test/cases/quoting_test.rb +++ b/activerecord/test/cases/quoting_test.rb @@ -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 | 
