##// END OF EJS Templates
Fixed: precedes/follows relations no longer update start/due dates (#5803)....
Jean-Philippe Lang -
r4149:f3baa5bfeeda
parent child
Show More
@@ -86,8 +86,8 class Issue < ActiveRecord::Base
86 }
86 }
87
87
88 before_create :default_assign
88 before_create :default_assign
89 before_save :reschedule_following_issues, :close_duplicates, :update_done_ratio_from_issue_status
89 before_save :close_duplicates, :update_done_ratio_from_issue_status
90 after_save :update_nested_set_attributes, :update_parent_attributes, :create_journal
90 after_save :reschedule_following_issues, :update_nested_set_attributes, :update_parent_attributes, :create_journal
91 after_destroy :destroy_children
91 after_destroy :destroy_children
92 after_destroy :update_parent_attributes
92 after_destroy :update_parent_attributes
93
93
@@ -503,6 +503,17 class IssueTest < ActiveSupport::TestCase
503 assert !closed_statuses.empty?
503 assert !closed_statuses.empty?
504 end
504 end
505
505
506 def test_rescheduling_an_issue_should_reschedule_following_issue
507 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)
508 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)
509 IssueRelation.create!(:issue_from => issue1, :issue_to => issue2, :relation_type => IssueRelation::TYPE_PRECEDES)
510 assert_equal issue1.due_date + 1, issue2.reload.start_date
511
512 issue1.due_date = Date.today + 5
513 issue1.save!
514 assert_equal issue1.due_date + 1, issue2.reload.start_date
515 end
516
506 def test_overdue
517 def test_overdue
507 assert Issue.new(:due_date => 1.day.ago.to_date).overdue?
518 assert Issue.new(:due_date => 1.day.ago.to_date).overdue?
508 assert !Issue.new(:due_date => Date.today).overdue?
519 assert !Issue.new(:due_date => Date.today).overdue?
General Comments 0
You need to be logged in to leave comments. Login now