copy = issue.reload.copy
assert_difference 'Issue.count', 1+issue.descendants.count do
assert copy.save
- assert copy.save
+ assert copy.reload.save
end
end
relation = new_record(IssueRelation) do
copy.save!
end
+ copy.reload
copy.parent_issue_id = parent.id
assert_save copy
:possible_values => ['value1', 'value2', 'value3'],
:multiple => true)
- issue = Issue.create!(:project_id => 1, :tracker_id => 1,
+ issue = Issue.generate!(:project_id => 1, :tracker_id => 1,
:subject => 'Test', :author_id => 1)
assert_difference 'Journal.count' do
def test_destroy_should_destroy_subtasks
issues =
(0..2).to_a.map do
- Issue.create!(:project_id => 1, :tracker_id => 1,
+ Issue.generate!(:project_id => 1, :tracker_id => 1,
:author_id => 1, :subject => 'test')
end
issues[0].update! :parent_issue_id => issues[1].id
end
def test_destroy_should_update_journals
- issue = Issue.create!(:project_id => 1, :author_id => 2,
+ issue = Issue.generate!(:project_id => 1, :author_id => 2,
:tracker_id => 1, :subject => 'foo')
issue.init_journal(User.find(2), "update")
issue.save!
end
def test_destroy_should_update_journal_details_old_value
- issue = Issue.create!(:project_id => 1, :author_id => 1,
+ issue = Issue.generate!(:project_id => 1, :author_id => 1,
:tracker_id => 1, :subject => 'foo', :assigned_to_id => 2)
issue.init_journal(User.find(1), "update")
issue.assigned_to_id = nil
end
def test_destroy_should_update_journal_details_value
- issue = Issue.create!(:project_id => 1, :author_id => 1,
+ issue = Issue.generate!(:project_id => 1, :author_id => 1,
:tracker_id => 1, :subject => 'foo')
issue.init_journal(User.find(1), "update")
issue.assigned_to_id = 2