From 3b7da88a839fe518bce0e6c215da834c0779cbaa Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 18 Dec 2016 08:54:26 +0000 Subject: Show an error message when changing an issue's project fails due to errors in child issues (#23888). git-svn-id: http://svn.redmine.org/redmine/trunk@16089 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/issue_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index e4e611153..844ed5934 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -1709,6 +1709,18 @@ class IssueTest < ActiveSupport::TestCase assert_equal 3, issue.tracker_id end + def test_move_to_another_project_should_set_error_message_on_child_failure + parent = Issue.generate! + child = Issue.generate!(:parent_issue_id => parent.id, :tracker_id => 2) + project = Project.generate!(:tracker_ids => [1]) + + parent.reload + parent.project_id = project.id + assert !parent.save + assert_include "Subtask ##{child.id} could not be moved to the new project: Tracker is not included in the list", + parent.errors[:base] + end + def test_copy_to_the_same_project issue = Issue.find(1) copy = issue.copy -- cgit v1.2.3