diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/query_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb index ef48a8ad8..a722807db 100644 --- a/test/unit/query_test.rb +++ b/test/unit/query_test.rb @@ -170,6 +170,22 @@ class QueryTest < ActiveSupport::TestCase assert_include "CAST(custom_values.value AS decimal(60,3)) BETWEEN 30.0 AND 40.0", query.statement find_issues_with_query(query) end + + def test_date_filter_should_not_accept_non_date_values + query = Query.new(:name => '_') + query.add_filter('created_on', '=', ['a']) + + assert query.has_filter?('created_on') + assert !query.valid? + end + + def test_relative_date_filter_should_not_accept_non_integer_values + query = Query.new(:name => '_') + query.add_filter('created_on', '>t-', ['a']) + + assert query.has_filter?('created_on') + assert !query.valid? + end def test_operator_date_equals query = Query.new(:name => '_') |