Project

General

Profile

Defect #24718 ยป reassigning-reported-hours-to-the-issue-about-to-deleted-should-fail.diff

patch - Go MAEDA, 2016-12-30 08:11

View differences:

app/controllers/issues_controller.rb (working copy)
if reassign_to.nil?
flash.now[:error] = l(:error_issue_not_found_in_project)
return
elsif @issues.include?(reassign_to)
flash.now[:error] = l(:error_reassigning_time_entries_to_deleting_issue)
return
else
TimeEntry.where(['issue_id IN (?)', @issues]).
update_all("issue_id = #{reassign_to.id}")
config/locales/en.yml (working copy)
error_no_tracker_allowed_for_new_issue_in_project: "The project doesn't have any trackers for which you can create an issue"
error_no_projects_with_tracker_allowed_for_new_issue: "There are no projects with trackers for which you can create an issue"
error_move_of_child_not_possible: "Subtask %{child} could not be moved to the new project: %{errors}"
error_reassigning_time_entries_to_deleting_issue: "Cannot reassign reported hours to the issue about to be deleted."
mail_subject_lost_password: "Your %{value} password"
mail_body_lost_password: 'To change your password, click on the following link:'
test/functional/issues_controller_test.rb (working copy)
end
end
assert_response :success
assert_no_difference 'Issue.count' do
assert_no_difference 'TimeEntry.count' do
# try to reassign time to the issue about to be deleted
delete :destroy, :ids => [1, 3], :todo => 'reassign', :reassign_to_id => 3
end
end
assert_response :success
end
def test_destroy_issues_from_different_projects
    (1-1/1)