@@ -68,8 +68,8 class Issue < ActiveRecord::Base | |||
|
68 | 68 | :conditions => ["#{Project.table_name}.status=#{Project::STATUS_ACTIVE}"] |
|
69 | 69 | |
|
70 | 70 | before_create :default_assign |
|
71 |
before_save |
|
|
72 | after_save :update_nested_set_attributes, :update_parent_attributes, :create_journal | |
|
71 | before_save :close_duplicates, :update_done_ratio_from_issue_status | |
|
72 | after_save :reschedule_following_issues, :update_nested_set_attributes, :update_parent_attributes, :create_journal | |
|
73 | 73 | after_destroy :destroy_children |
|
74 | 74 | after_destroy :update_parent_attributes |
|
75 | 75 |
@@ -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