1514 |
1514 |
end
|
1515 |
1515 |
|
1516 |
1516 |
def test_rescheduling_an_issue_to_a_later_due_date_should_reschedule_following_issue
|
1517 |
|
issue1 = Issue.generate!(:start_date => '2012-10-15', :due_date => '2012-10-17')
|
1518 |
|
issue2 = Issue.generate!(:start_date => '2012-10-15', :due_date => '2012-10-17')
|
1519 |
|
IssueRelation.create!(:issue_from => issue1, :issue_to => issue2,
|
1520 |
|
:relation_type => IssueRelation::TYPE_PRECEDES)
|
1521 |
|
assert_equal Date.parse('2012-10-18'), issue2.reload.start_date
|
|
1517 |
with_settings :non_working_week_days => [] do
|
|
1518 |
issue1 = Issue.generate!(:start_date => '2012-10-15', :due_date => '2012-10-17')
|
|
1519 |
issue2 = Issue.generate!(:start_date => '2012-10-15', :due_date => '2012-10-17')
|
|
1520 |
IssueRelation.create!(:issue_from => issue1, :issue_to => issue2,
|
|
1521 |
:relation_type => IssueRelation::TYPE_PRECEDES)
|
|
1522 |
assert_equal Date.parse('2012-10-18'), issue2.reload.start_date
|
|
1523 |
|
|
1524 |
issue1.reload
|
|
1525 |
issue1.due_date = '2012-10-23'
|
|
1526 |
issue1.save!
|
|
1527 |
issue2.reload
|
|
1528 |
assert_equal Date.parse('2012-10-24'), issue2.start_date
|
|
1529 |
assert_equal Date.parse('2012-10-26'), issue2.due_date
|
|
1530 |
end
|
1522 |
1531 |
|
1523 |
|
issue1.reload
|
1524 |
|
issue1.due_date = '2012-10-23'
|
1525 |
|
issue1.save!
|
1526 |
|
issue2.reload
|
1527 |
|
assert_equal Date.parse('2012-10-24'), issue2.start_date
|
1528 |
|
assert_equal Date.parse('2012-10-26'), issue2.due_date
|
|
1532 |
# The delay should honor non-working week days
|
|
1533 |
with_settings :non_working_week_days => %w(6 7) do
|
|
1534 |
issue1 = Issue.generate!(:start_date => '2014-03-10', :due_date => '2014-03-12')
|
|
1535 |
issue2 = Issue.generate!(:start_date => '2014-03-10', :due_date => '2014-03-12')
|
|
1536 |
IssueRelation.create!(:issue_from => issue1, :issue_to => issue2,
|
|
1537 |
:relation_type => IssueRelation::TYPE_PRECEDES,
|
|
1538 |
:delay => 8)
|
|
1539 |
assert_equal Date.parse('2014-03-25'), issue2.reload.start_date
|
|
1540 |
end
|
1529 |
1541 |
end
|
1530 |
1542 |
|
1531 |
1543 |
def test_rescheduling_an_issue_to_an_earlier_due_date_should_reschedule_following_issue
|