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
This commit is contained in:
Jean-Philippe Lang 2012-09-16 14:09:41 +00:00
parent ff0989a702
commit a81da3491e
2 changed files with 6 additions and 1 deletions

View 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?

View 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