diff test/unit/query_test.rb @ 1517:dffacf8a6908 redmine-2.5

Update to Redmine SVN revision 13367 on 2.5-stable branch
author Chris Cannam
date Tue, 09 Sep 2014 09:29:00 +0100
parents e248c7af89ec
children
line wrap: on
line diff
--- a/test/unit/query_test.rb	Tue Sep 09 09:28:31 2014 +0100
+++ b/test/unit/query_test.rb	Tue Sep 09 09:29:00 2014 +0100
@@ -209,8 +209,7 @@
   end
 
   def test_operator_is_on_float
-    Issue.update_all("estimated_hours = 171.2", "id=2")
-
+    Issue.where(:id => 2).update_all("estimated_hours = 171.2")
     query = IssueQuery.new(:name => '_')
     query.add_filter('estimated_hours', '=', ['171.20'])
     issues = find_issues_with_query(query)
@@ -449,6 +448,13 @@
     find_issues_with_query(query)
   end
 
+  def test_operator_date_lesser_than_with_timestamp
+    query = IssueQuery.new(:name => '_')
+    query.add_filter('updated_on', '<=', ['2011-07-10T19:13:52'])
+    assert_match /issues\.updated_on <= '2011-07-10 19:13:52/, query.statement
+    find_issues_with_query(query)
+  end
+
   def test_operator_date_greater_than
     query = IssueQuery.new(:name => '_')
     query.add_filter('due_date', '>=', ['2011-07-10'])
@@ -456,6 +462,13 @@
     find_issues_with_query(query)
   end
 
+  def test_operator_date_greater_than_with_timestamp
+    query = IssueQuery.new(:name => '_')
+    query.add_filter('updated_on', '>=', ['2011-07-10T19:13:52'])
+    assert_match /issues\.updated_on > '2011-07-10 19:13:51(\.0+)?'/, query.statement
+    find_issues_with_query(query)
+  end
+
   def test_operator_date_between
     query = IssueQuery.new(:name => '_')
     query.add_filter('due_date', '><', ['2011-06-23', '2011-07-10'])