[#123] Fix test error due to un-reloaded object daddy objects
This commit is contained in:
parent
cc0c2165b5
commit
cd73bd714f
|
@ -232,13 +232,13 @@ class IssueNestedSetTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
def test_destroy_child_issue_with_children
|
||||
root = Issue.create!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'root')
|
||||
child = Issue.create!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'child', :parent_issue_id => root.id)
|
||||
leaf = Issue.create!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'leaf', :parent_issue_id => child.id)
|
||||
root = Issue.create!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'root').reload
|
||||
child = Issue.create!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'child', :parent_issue_id => root.id).reload
|
||||
leaf = Issue.create!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'leaf', :parent_issue_id => child.id).reload
|
||||
leaf.init_journal(User.find(2))
|
||||
leaf.subject = 'leaf with journal'
|
||||
leaf.save!
|
||||
|
||||
|
||||
assert_difference 'Issue.count', -2 do
|
||||
assert_difference 'IssueJournal.count', -3 do
|
||||
Issue.find(child.id).destroy
|
||||
|
|
Loading…
Reference in New Issue