From a81da3491e1b0070e751fa97e192045f894a4291 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 16 Sep 2012 14:09:41 +0000 Subject: [PATCH] Do not consider that versions that are due today are completed. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10397 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/version.rb | 2 +- test/unit/version_test.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/version.rb b/app/models/version.rb index cd32da91e..d0fe02973 100644 --- a/app/models/version.rb +++ b/app/models/version.rb @@ -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? diff --git a/test/unit/version_test.rb b/test/unit/version_test.rb index d80c3d10f..e9b485479 100644 --- a/test/unit/version_test.rb +++ b/test/unit/version_test.rb @@ -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