]> source.dussan.org Git - redmine.git/commitdiff
Fix the test (#4502).
authorGo MAEDA <maeda@farend.jp>
Wed, 13 Mar 2019 15:50:24 +0000 (15:50 +0000)
committerGo MAEDA <maeda@farend.jp>
Wed, 13 Mar 2019 15:50:24 +0000 (15:50 +0000)
Patch by Mizuki ISHIKAWA.

git-svn-id: http://svn.redmine.org/redmine/trunk@17942 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/query_test.rb

index 4a4361fe914830b1c8ab51f401c379d92f509d1e..3fa1da1f911ffe15440333d8d1a3ff2251294e28 100644 (file)
@@ -659,11 +659,15 @@ class QueryTest < ActiveSupport::TestCase
   end
 
   def test_operator_tomorrow
+    issue = Issue.generate!(:due_date => User.current.today.tomorrow)
+    other_issues = []
+    other_issues << Issue.generate!(:due_date => User.current.today.yesterday)
+    other_issues << Issue.generate!(:due_date => User.current.today + 2)
     query = IssueQuery.new(:project => Project.find(1), :name => '_')
     query.add_filter('due_date', 'nd', [''])
     issues = find_issues_with_query(query)
-    assert !issues.empty?
-    issues.each {|issue| assert_equal Date.today.tomorrow, issue.due_date}
+    assert_include issue, issues
+    other_issues.each {|i| assert_not_include i, issues }
   end
 
   def test_operator_date_periods