##// END OF EJS Templates
code layout clean up context "#behind_schedule?" of unit issue test...
Toshi MARUYAMA -
r10423:0bcc6115c3f3
parent child
Show More
@@ -1231,23 +1231,33 class IssueTest < ActiveSupport::TestCase
1231 1231
1232 1232 context "#behind_schedule?" do
1233 1233 should "be false if the issue has no start_date" do
1234 assert !Issue.new(:start_date => nil, :due_date => 1.day.from_now.to_date, :done_ratio => 0).behind_schedule?
1234 assert !Issue.new(:start_date => nil,
1235 :due_date => 1.day.from_now.to_date,
1236 :done_ratio => 0).behind_schedule?
1235 1237 end
1236 1238
1237 1239 should "be false if the issue has no end_date" do
1238 assert !Issue.new(:start_date => 1.day.from_now.to_date, :due_date => nil, :done_ratio => 0).behind_schedule?
1240 assert !Issue.new(:start_date => 1.day.from_now.to_date,
1241 :due_date => nil,
1242 :done_ratio => 0).behind_schedule?
1239 1243 end
1240 1244
1241 1245 should "be false if the issue has more done than it's calendar time" do
1242 assert !Issue.new(:start_date => 50.days.ago.to_date, :due_date => 50.days.from_now.to_date, :done_ratio => 90).behind_schedule?
1246 assert !Issue.new(:start_date => 50.days.ago.to_date,
1247 :due_date => 50.days.from_now.to_date,
1248 :done_ratio => 90).behind_schedule?
1243 1249 end
1244 1250
1245 1251 should "be true if the issue hasn't been started at all" do
1246 assert Issue.new(:start_date => 1.day.ago.to_date, :due_date => 1.day.from_now.to_date, :done_ratio => 0).behind_schedule?
1252 assert Issue.new(:start_date => 1.day.ago.to_date,
1253 :due_date => 1.day.from_now.to_date,
1254 :done_ratio => 0).behind_schedule?
1247 1255 end
1248 1256
1249 1257 should "be true if the issue has used more calendar time than it's done ratio" do
1250 assert Issue.new(:start_date => 100.days.ago.to_date, :due_date => Date.today, :done_ratio => 90).behind_schedule?
1258 assert Issue.new(:start_date => 100.days.ago.to_date,
1259 :due_date => Date.today,
1260 :done_ratio => 90).behind_schedule?
1251 1261 end
1252 1262 end
1253 1263
General Comments 0
You need to be logged in to leave comments. Login now