summaryrefslogtreecommitdiffstats
path: root/test/unit/helpers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-04-17 15:17:18 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-04-17 15:17:18 +0000
commitf89d04074e56ea64845a681b83896b0bea163363 (patch)
tree8905f78979f949be602e41d44670f189e6495204 /test/unit/helpers
parenta96f7053fc89d38ac4b5734e4515b4ae7550f4d1 (diff)
downloadredmine-f89d04074e56ea64845a681b83896b0bea163363.tar.gz
redmine-f89d04074e56ea64845a681b83896b0bea163363.zip
Warn about subtasks before deleting a parent issue (#6562).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5495 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/helpers')
-rw-r--r--test/unit/helpers/issues_helper_test.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/unit/helpers/issues_helper_test.rb b/test/unit/helpers/issues_helper_test.rb
index dcb1aed85..7a40abe08 100644
--- a/test/unit/helpers/issues_helper_test.rb
+++ b/test/unit/helpers/issues_helper_test.rb
@@ -47,6 +47,25 @@ class IssuesHelperTest < HelperTestCase
def test_issue_heading
assert_equal "Bug #1", issue_heading(Issue.find(1))
end
+
+ def test_issues_destroy_confirmation_message_with_one_root_issue
+ assert_equal l(:text_issues_destroy_confirmation), issues_destroy_confirmation_message(Issue.find(1))
+ end
+
+ def test_issues_destroy_confirmation_message_with_an_arrayt_of_root_issues
+ assert_equal l(:text_issues_destroy_confirmation), issues_destroy_confirmation_message(Issue.find([1, 2]))
+ end
+
+ def test_issues_destroy_confirmation_message_with_one_parent_issue
+ Issue.find(2).update_attribute :parent_issue_id, 1
+ assert_equal l(:text_issues_destroy_confirmation) + "\n" + l(:text_issues_destroy_descendants_confirmation, :count => 1),
+ issues_destroy_confirmation_message(Issue.find(1))
+ end
+
+ def test_issues_destroy_confirmation_message_with_one_parent_issue_and_its_child
+ Issue.find(2).update_attribute :parent_issue_id, 1
+ assert_equal l(:text_issues_destroy_confirmation), issues_destroy_confirmation_message(Issue.find([1, 2]))
+ end
context "IssuesHelper#show_detail" do
context "with no_html" do