]> source.dussan.org Git - redmine.git/commitdiff
Do not consider that versions that are due today are completed.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 16 Sep 2012 14:09:41 +0000 (14:09 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 16 Sep 2012 14:09:41 +0000 (14:09 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10397 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/version.rb
test/unit/version_test.rb

index cd32da91e62a90828e1fefc3b90868a14b2e2232..d0fe02973e16282a45503ad8384ffc30b8c3724f 100644 (file)
@@ -91,7 +91,7 @@ class Version < ActiveRecord::Base
 
   # Returns true if the version is completed: due date reached and no open issues
   def completed?
-    effective_date && (effective_date <= Date.today) && (open_issues_count == 0)
+    effective_date && (effective_date < Date.today) && (open_issues_count == 0)
   end
 
   def behind_schedule?
index d80c3d10fb45b23ea58833357683bf2ef8b2b80b..e9b485479032817a408e993479ab1493334c054c 100644 (file)
@@ -119,6 +119,11 @@ class VersionTest < ActiveSupport::TestCase
     assert_equal [v5, v3, v1, v2, v4], Version.sorted.all
   end
 
+  def test_completed_should_be_false_when_due_today
+    version = Version.create!(:project_id => 1, :effective_date => Date.today, :name => 'Due today')
+    assert_equal false, version.completed?
+  end
+
   context "#behind_schedule?" do
     setup do
       ProjectCustomField.destroy_all # Custom values are a mess to isolate in tests