@@ -86,8 +86,8 class Issue < ActiveRecord::Base | |||
|
86 | 86 | } |
|
87 | 87 | |
|
88 | 88 | before_create :default_assign |
|
89 |
before_save |
|
|
90 | after_save :update_nested_set_attributes, :update_parent_attributes, :create_journal | |
|
89 | before_save :close_duplicates, :update_done_ratio_from_issue_status | |
|
90 | after_save :reschedule_following_issues, :update_nested_set_attributes, :update_parent_attributes, :create_journal | |
|
91 | 91 | after_destroy :destroy_children |
|
92 | 92 | after_destroy :update_parent_attributes |
|
93 | 93 |
@@ -503,6 +503,17 class IssueTest < ActiveSupport::TestCase | |||
|
503 | 503 | assert !closed_statuses.empty? |
|
504 | 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 | 517 | def test_overdue |
|
507 | 518 | assert Issue.new(:due_date => 1.day.ago.to_date).overdue? |
|
508 | 519 | assert !Issue.new(:due_date => Date.today).overdue? |
General Comments 0
You need to be logged in to leave comments.
Login now