Defect #24718 ยป reassigning-reported-hours-to-the-issue-about-to-deleted-should-fail.diff
app/controllers/issues_controller.rb (working copy) | ||
---|---|---|
355 | 355 |
if reassign_to.nil? |
356 | 356 |
flash.now[:error] = l(:error_issue_not_found_in_project) |
357 | 357 |
return |
358 |
elsif @issues.include?(reassign_to) |
|
359 |
flash.now[:error] = l(:error_reassigning_time_entries_to_deleting_issue) |
|
360 |
return |
|
358 | 361 |
else |
359 | 362 |
TimeEntry.where(['issue_id IN (?)', @issues]). |
360 | 363 |
update_all("issue_id = #{reassign_to.id}") |
config/locales/en.yml (working copy) | ||
---|---|---|
218 | 218 |
error_no_tracker_allowed_for_new_issue_in_project: "The project doesn't have any trackers for which you can create an issue" |
219 | 219 |
error_no_projects_with_tracker_allowed_for_new_issue: "There are no projects with trackers for which you can create an issue" |
220 | 220 |
error_move_of_child_not_possible: "Subtask %{child} could not be moved to the new project: %{errors}" |
221 |
error_reassigning_time_entries_to_deleting_issue: "Cannot reassign reported hours to the issue about to be deleted." |
|
221 | 222 | |
222 | 223 |
mail_subject_lost_password: "Your %{value} password" |
223 | 224 |
mail_body_lost_password: 'To change your password, click on the following link:' |
test/functional/issues_controller_test.rb (working copy) | ||
---|---|---|
4684 | 4684 |
end |
4685 | 4685 |
end |
4686 | 4686 |
assert_response :success |
4687 | ||
4688 |
assert_no_difference 'Issue.count' do |
|
4689 |
assert_no_difference 'TimeEntry.count' do |
|
4690 |
# try to reassign time to the issue about to be deleted |
|
4691 |
delete :destroy, :ids => [1, 3], :todo => 'reassign', :reassign_to_id => 3 |
|
4692 |
end |
|
4693 |
end |
|
4694 |
assert_response :success |
|
4687 | 4695 |
end |
4688 | 4696 | |
4689 | 4697 |
def test_destroy_issues_from_different_projects |