Commit d1a2cd86 authored by jplang's avatar jplang

Fixed: precedes/follows relations no longer update start/due dates (#5803).

git-svn-id: https://svn.redmine.org/redmine/trunk@4263 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 320c40c5
......@@ -86,8 +86,8 @@ class Issue < ActiveRecord::Base
}
before_create :default_assign
before_save :reschedule_following_issues, :close_duplicates, :update_done_ratio_from_issue_status
after_save :update_nested_set_attributes, :update_parent_attributes, :create_journal
before_save :close_duplicates, :update_done_ratio_from_issue_status
after_save :reschedule_following_issues, :update_nested_set_attributes, :update_parent_attributes, :create_journal
after_destroy :destroy_children
after_destroy :update_parent_attributes
......
......@@ -503,6 +503,17 @@ class IssueTest < ActiveSupport::TestCase
assert !closed_statuses.empty?
end
def test_rescheduling_an_issue_should_reschedule_following_issue
issue1 = Issue.create!(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :subject => '-', :start_date => Date.today, :due_date => Date.today + 2)
issue2 = Issue.create!(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :subject => '-', :start_date => Date.today, :due_date => Date.today + 2)
IssueRelation.create!(:issue_from => issue1, :issue_to => issue2, :relation_type => IssueRelation::TYPE_PRECEDES)
assert_equal issue1.due_date + 1, issue2.reload.start_date
issue1.due_date = Date.today + 5
issue1.save!
assert_equal issue1.due_date + 1, issue2.reload.start_date
end
def test_overdue
assert Issue.new(:due_date => 1.day.ago.to_date).overdue?
assert !Issue.new(:due_date => Date.today).overdue?
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment