Commit cd73bd71 authored by Eric Davis's avatar Eric Davis

[#123] Fix test error due to un-reloaded object daddy objects

parent cc0c2165
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment