##// END OF EJS Templates
Do not consider that versions that are due today are completed....
Jean-Philippe Lang -
r10214:a81da3491e1b
parent child
Show More
@@ -91,7 +91,7 class Version < ActiveRecord::Base
91
91
92 # Returns true if the version is completed: due date reached and no open issues
92 # Returns true if the version is completed: due date reached and no open issues
93 def completed?
93 def completed?
94 effective_date && (effective_date <= Date.today) && (open_issues_count == 0)
94 effective_date && (effective_date < Date.today) && (open_issues_count == 0)
95 end
95 end
96
96
97 def behind_schedule?
97 def behind_schedule?
@@ -119,6 +119,11 class VersionTest < ActiveSupport::TestCase
119 assert_equal [v5, v3, v1, v2, v4], Version.sorted.all
119 assert_equal [v5, v3, v1, v2, v4], Version.sorted.all
120 end
120 end
121
121
122 def test_completed_should_be_false_when_due_today
123 version = Version.create!(:project_id => 1, :effective_date => Date.today, :name => 'Due today')
124 assert_equal false, version.completed?
125 end
126
122 context "#behind_schedule?" do
127 context "#behind_schedule?" do
123 setup do
128 setup do
124 ProjectCustomField.destroy_all # Custom values are a mess to isolate in tests
129 ProjectCustomField.destroy_all # Custom values are a mess to isolate in tests
General Comments 0
You need to be logged in to leave comments. Login now