summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-07-11 14:36:43 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-07-11 14:36:43 +0000
commit6c5b29bb681ba1f11de2c04e78de1d306bcf7883 (patch)
treea519e1404cb8838cde7c19fac1d1f867a6b182f5 /test/unit
parent308a922d80331d139b576d44728e1c49d5321a7f (diff)
downloadredmine-6c5b29bb681ba1f11de2c04e78de1d306bcf7883.tar.gz
redmine-6c5b29bb681ba1f11de2c04e78de1d306bcf7883.zip
More accurate date validation.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6265 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/query_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb
index a722807db..328acc489 100644
--- a/test/unit/query_test.rb
+++ b/test/unit/query_test.rb
@@ -179,6 +179,14 @@ class QueryTest < ActiveSupport::TestCase
assert !query.valid?
end
+ def test_date_filter_should_not_accept_invalid_date_values
+ query = Query.new(:name => '_')
+ query.add_filter('created_on', '=', ['2011-01-34'])
+
+ 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'])