diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2013-05-19 02:09:39 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2013-05-19 02:09:39 +0000 |
commit | 1f9e1ca3181b77388e88456354c72b2d85c080a3 (patch) | |
tree | 4bb47d64b792759dfa553e8e5210c32c7f6943b4 /test/unit/helpers/issues_helper_test.rb | |
parent | e5e73a56a76d1da8cd5455f29e48ded7c0581e5f (diff) | |
download | redmine-1f9e1ca3181b77388e88456354c72b2d85c080a3.tar.gz redmine-1f9e1ca3181b77388e88456354c72b2d85c080a3.zip |
add journal after creating/deleting issue relation (#1005)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11885 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/helpers/issues_helper_test.rb')
-rw-r--r-- | test/unit/helpers/issues_helper_test.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/unit/helpers/issues_helper_test.rb b/test/unit/helpers/issues_helper_test.rb index 327ca0710..c775bc865 100644 --- a/test/unit/helpers/issues_helper_test.rb +++ b/test/unit/helpers/issues_helper_test.rb @@ -210,4 +210,36 @@ class IssuesHelperTest < ActionView::TestCase :old_value => 'error281.txt', :value => nil) assert_match 'error281.txt', show_detail(detail, true) end + + def test_show_detail_create_relation + detail = JournalDetail.new(:property => 'relation', + :prop_key => 'label_precedes', + :value => 1) + assert_equal "Precedes Bug #1: Can't print recipes added", show_detail(detail, true) + assert_match %r{<strong>Precedes</strong> <i><a href="/issues/1" class=".+">Bug #1</a>: Can't print recipes</i> added}, + show_detail(detail, false) + non_existed_issue_number = 9999 + assert_nil Issue.find_by_id(non_existed_issue_number) + detail = JournalDetail.new(:property => 'relation', + :prop_key => 'label_precedes', + :value => non_existed_issue_number) + assert_equal "Precedes Issue #{non_existed_issue_number} added", show_detail(detail, true) + assert_equal "<strong>Precedes</strong> <i>Issue #{non_existed_issue_number}</i> added", show_detail(detail, false) + end + + def test_show_detail_delete_relation + detail = JournalDetail.new(:property => 'relation', + :prop_key => 'label_precedes', + :old_value => 1) + assert_equal "Precedes deleted (Bug #1: Can't print recipes)", show_detail(detail, true) + assert_match %r{<strong>Precedes</strong> deleted \(<del><i><a href="/issues/1" class=".+">Bug #1</a>: Can't print recipes</i></del>\)}, + show_detail(detail, false) + non_existed_issue_number = 9999 + assert_nil Issue.find_by_id(non_existed_issue_number) + detail = JournalDetail.new(:property => 'relation', + :prop_key => 'label_precedes', + :old_value => non_existed_issue_number) + assert_equal "Precedes deleted (Issue 9999)", show_detail(detail, true) + assert_equal "<strong>Precedes</strong> deleted (<del><i>Issue 9999</i></del>)", show_detail(detail, false) + end end |