diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-02 15:38:11 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-02 15:38:11 +0000 |
commit | 32b79b6fd4e3a523ee393d7a3e2bb60dbeed77c3 (patch) | |
tree | 5050ce8fcb138d88180d9c3d61e34c05dc03a4d8 /test/unit/issue_relation_test.rb | |
parent | 43f6914f520f9a79220414cdd5d54d6fa2cc0720 (diff) | |
download | redmine-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/issue_relation_test.rb')
-rw-r--r-- | test/unit/issue_relation_test.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/unit/issue_relation_test.rb b/test/unit/issue_relation_test.rb index 27a47fcfe..086373bd2 100644 --- a/test/unit/issue_relation_test.rb +++ b/test/unit/issue_relation_test.rb @@ -169,13 +169,14 @@ class IssueRelationTest < ActiveSupport::TestCase assert_not_equal [], r.errors[:base] end - def test_create_should_make_journal_entry + def test_create_with_initialized_journals_should_create_journals from = Issue.find(1) to = Issue.find(2) from_journals = from.journals.size to_journals = to.journals.size relation = IssueRelation.new(:issue_from => from, :issue_to => to, :relation_type => IssueRelation::TYPE_PRECEDES) + relation.init_journals User.find(1) assert relation.save from.reload to.reload @@ -192,12 +193,13 @@ class IssueRelationTest < ActiveSupport::TestCase assert_nil to.journals.last.details.last.old_value end - def test_delete_should_make_journal_entry + def test_destroy_with_initialized_journals_should_create_journals relation = IssueRelation.find(1) from = relation.issue_from to = relation.issue_to from_journals = from.journals.size to_journals = to.journals.size + relation.init_journals User.find(1) assert relation.destroy from.reload to.reload |