summaryrefslogtreecommitdiffstats
path: root/test/unit/journal_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-02 15:38:11 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-02 15:38:11 +0000
commit32b79b6fd4e3a523ee393d7a3e2bb60dbeed77c3 (patch)
tree5050ce8fcb138d88180d9c3d61e34c05dc03a4d8 /test/unit/journal_test.rb
parent43f6914f520f9a79220414cdd5d54d6fa2cc0720 (diff)
downloadredmine-32b79b6fd4e3a523ee393d7a3e2bb60dbeed77c3.tar.gz
redmine-32b79b6fd4e3a523ee393d7a3e2bb60dbeed77c3.zip
Fixed that IssueRelation should not be responsible for calling Issue#init_journal (#18237).
git-svn-id: http://svn.redmine.org/redmine/trunk@13534 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/journal_test.rb')
-rw-r--r--test/unit/journal_test.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/test/unit/journal_test.rb b/test/unit/journal_test.rb
index 36f494807..37ca413c4 100644
--- a/test/unit/journal_test.rb
+++ b/test/unit/journal_test.rb
@@ -207,17 +207,15 @@ class JournalTest < ActiveSupport::TestCase
def test_visible_details_should_include_relations_to_visible_issues_only
issue = Issue.generate!
visible_issue = Issue.generate!
- IssueRelation.create!(:issue_from => issue, :issue_to => visible_issue, :relation_type => 'relates')
hidden_issue = Issue.generate!(:is_private => true)
- IssueRelation.create!(:issue_from => issue, :issue_to => hidden_issue, :relation_type => 'relates')
- issue.reload
- assert_equal 1, issue.journals.size
- journal = issue.journals.first
- assert_equal 2, journal.details.size
+
+ journal = Journal.new
+ journal.details << JournalDetail.new(:property => 'relation', :prop_key => 'relates', :value => visible_issue.id)
+ journal.details << JournalDetail.new(:property => 'relation', :prop_key => 'relates', :value => hidden_issue.id)
visible_details = journal.visible_details(User.anonymous)
assert_equal 1, visible_details.size
- assert_equal visible_issue.id.to_s, visible_details.first.value
+ assert_equal visible_issue.id.to_s, visible_details.first.value.to_s
visible_details = journal.visible_details(User.find(2))
assert_equal 2, visible_details.size