2078 |
2078 |
end
|
2079 |
2079 |
|
2080 |
2080 |
def test_rescheduling_an_issue_to_a_later_due_date_should_reschedule_following_issue
|
2081 |
|
issue1 = Issue.generate!(:start_date => '2012-10-15', :due_date => '2012-10-17')
|
2082 |
|
issue2 = Issue.generate!(:start_date => '2012-10-15', :due_date => '2012-10-17')
|
2083 |
|
IssueRelation.create!(:issue_from => issue1, :issue_to => issue2,
|
2084 |
|
:relation_type => IssueRelation::TYPE_PRECEDES)
|
2085 |
|
assert_equal Date.parse('2012-10-18'), issue2.reload.start_date
|
|
2081 |
with_settings :non_working_week_days => [] do
|
|
2082 |
issue1 = Issue.generate!(:start_date => '2012-10-15', :due_date => '2012-10-17')
|
|
2083 |
issue2 = Issue.generate!(:start_date => '2012-10-15', :due_date => '2012-10-17')
|
|
2084 |
IssueRelation.create!(:issue_from => issue1, :issue_to => issue2,
|
|
2085 |
:relation_type => IssueRelation::TYPE_PRECEDES)
|
|
2086 |
assert_equal Date.parse('2012-10-18'), issue2.reload.start_date
|
|
2087 |
|
|
2088 |
issue1.reload
|
|
2089 |
issue1.due_date = '2012-10-23'
|
|
2090 |
issue1.save!
|
|
2091 |
issue2.reload
|
|
2092 |
assert_equal Date.parse('2012-10-24'), issue2.start_date
|
|
2093 |
assert_equal Date.parse('2012-10-26'), issue2.due_date
|
|
2094 |
end
|
2086 |
2095 |
|
2087 |
|
issue1.reload
|
2088 |
|
issue1.due_date = '2012-10-23'
|
2089 |
|
issue1.save!
|
2090 |
|
issue2.reload
|
2091 |
|
assert_equal Date.parse('2012-10-24'), issue2.start_date
|
2092 |
|
assert_equal Date.parse('2012-10-26'), issue2.due_date
|
|
2096 |
# The delay should honor non-working week days
|
|
2097 |
with_settings :non_working_week_days => %w(6 7) do
|
|
2098 |
issue1 = Issue.generate!(:start_date => '2014-03-10', :due_date => '2014-03-12')
|
|
2099 |
issue2 = Issue.generate!(:start_date => '2014-03-10', :due_date => '2014-03-12')
|
|
2100 |
IssueRelation.create!(:issue_from => issue1, :issue_to => issue2,
|
|
2101 |
:relation_type => IssueRelation::TYPE_PRECEDES,
|
|
2102 |
:delay => 8)
|
|
2103 |
assert_equal Date.parse('2014-03-25'), issue2.reload.start_date
|
|
2104 |
end
|
2093 |
2105 |
end
|
2094 |
2106 |
|
2095 |
2107 |
def test_rescheduling_an_issue_to_an_earlier_due_date_should_reschedule_following_issue
|