Use fixtures generator.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8294 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
f5987a5ca0
commit
aec1828fc7
|
@ -408,21 +408,17 @@ class IssueTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
def test_should_close_duplicates
|
def test_should_close_duplicates
|
||||||
# Create 3 issues
|
# Create 3 issues
|
||||||
issue1 = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1,
|
project = Project.find(1)
|
||||||
:status_id => 1, :priority => IssuePriority.all.first,
|
issue1 = Issue.generate_for_project!(project)
|
||||||
:subject => 'Duplicates test', :description => 'Duplicates test')
|
issue2 = Issue.generate_for_project!(project)
|
||||||
assert issue1.save
|
issue3 = Issue.generate_for_project!(project)
|
||||||
issue2 = issue1.clone
|
|
||||||
assert issue2.save
|
|
||||||
issue3 = issue1.clone
|
|
||||||
assert issue3.save
|
|
||||||
|
|
||||||
# 2 is a dupe of 1
|
# 2 is a dupe of 1
|
||||||
IssueRelation.create(:issue_from => issue2, :issue_to => issue1, :relation_type => IssueRelation::TYPE_DUPLICATES)
|
IssueRelation.create!(:issue_from => issue2, :issue_to => issue1, :relation_type => IssueRelation::TYPE_DUPLICATES)
|
||||||
# And 3 is a dupe of 2
|
# And 3 is a dupe of 2
|
||||||
IssueRelation.create(:issue_from => issue3, :issue_to => issue2, :relation_type => IssueRelation::TYPE_DUPLICATES)
|
IssueRelation.create!(:issue_from => issue3, :issue_to => issue2, :relation_type => IssueRelation::TYPE_DUPLICATES)
|
||||||
# And 3 is a dupe of 1 (circular duplicates)
|
# And 3 is a dupe of 1 (circular duplicates)
|
||||||
IssueRelation.create(:issue_from => issue3, :issue_to => issue1, :relation_type => IssueRelation::TYPE_DUPLICATES)
|
IssueRelation.create!(:issue_from => issue3, :issue_to => issue1, :relation_type => IssueRelation::TYPE_DUPLICATES)
|
||||||
|
|
||||||
assert issue1.reload.duplicates.include?(issue2)
|
assert issue1.reload.duplicates.include?(issue2)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue