diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-06-06 16:25:51 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-06-06 16:25:51 +0000 |
commit | 2a00c33a614919178cc6aea3a79e4d5cc4e0e813 (patch) | |
tree | 908f07a274b3db2c942909c2376a4113e66f1603 /test/unit/helpers/issues_helper_test.rb | |
parent | d90f46a5da07a4945751bd4b65d6754a8f475b91 (diff) | |
download | redmine-2a00c33a614919178cc6aea3a79e4d5cc4e0e813.tar.gz redmine-2a00c33a614919178cc6aea3a79e4d5cc4e0e813.zip |
Splits tests (#1005).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11941 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 | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/test/unit/helpers/issues_helper_test.rb b/test/unit/helpers/issues_helper_test.rb index edf66b732..ce27e6afe 100644 --- a/test/unit/helpers/issues_helper_test.rb +++ b/test/unit/helpers/issues_helper_test.rb @@ -211,20 +211,23 @@ class IssuesHelperTest < ActionView::TestCase assert_match 'error281.txt', show_detail(detail, true) end - def test_show_detail_create_relation + def test_show_detail_relation_added 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) + end + + def test_show_detail_relation_added_with_inexistant_issue + inexistant_issue_number = 9999 + assert_nil Issue.find_by_id(inexistant_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) + :value => inexistant_issue_number) + assert_equal "Precedes Issue ##{inexistant_issue_number} added", show_detail(detail, true) + assert_equal "<strong>Precedes</strong> <i>Issue ##{inexistant_issue_number}</i> added", show_detail(detail, false) end def test_show_detail_relation_added_should_not_disclose_issue_that_is_not_visible @@ -237,18 +240,21 @@ class IssuesHelperTest < ActionView::TestCase assert_equal "<strong>Precedes</strong> <i>Issue ##{issue.id}</i> added", show_detail(detail, false) end - def test_show_detail_delete_relation + def test_show_detail_relation_deleted 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 \(<i><a href="/issues/1" class=".+">Bug #1</a>: Can't print recipes</i>\)}, show_detail(detail, false) - non_existed_issue_number = 9999 - assert_nil Issue.find_by_id(non_existed_issue_number) + end + + def test_show_detail_relation_deleted_with_inexistant_issue + inexistant_issue_number = 9999 + assert_nil Issue.find_by_id(inexistant_issue_number) detail = JournalDetail.new(:property => 'relation', :prop_key => 'label_precedes', - :old_value => non_existed_issue_number) + :old_value => inexistant_issue_number) assert_equal "Precedes deleted (Issue #9999)", show_detail(detail, true) assert_equal "<strong>Precedes</strong> deleted (<i>Issue #9999</i>)", show_detail(detail, false) end |