code layout clean up of test_all_dependent_issues_with_persistent_multiple_circular_dependencies at test/unit/issue_test.rb

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7462 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-09-23 06:17:18 +00:00
parent 7a2f8588ee
commit 8af3c5a7db
1 changed files with 15 additions and 5 deletions

View File

@ -856,12 +856,22 @@ class IssueTest < ActiveSupport::TestCase
def test_all_dependent_issues_with_persistent_multiple_circular_dependencies def test_all_dependent_issues_with_persistent_multiple_circular_dependencies
IssueRelation.delete_all IssueRelation.delete_all
assert IssueRelation.create!(:issue_from => Issue.find(1), :issue_to => Issue.find(2), :relation_type => IssueRelation::TYPE_RELATES) assert IssueRelation.create!(:issue_from => Issue.find(1),
assert IssueRelation.create!(:issue_from => Issue.find(2), :issue_to => Issue.find(3), :relation_type => IssueRelation::TYPE_RELATES) :issue_to => Issue.find(2),
assert IssueRelation.create!(:issue_from => Issue.find(3), :issue_to => Issue.find(8), :relation_type => IssueRelation::TYPE_RELATES) :relation_type => IssueRelation::TYPE_RELATES)
assert IssueRelation.create!(:issue_from => Issue.find(2),
:issue_to => Issue.find(3),
:relation_type => IssueRelation::TYPE_RELATES)
assert IssueRelation.create!(:issue_from => Issue.find(3),
:issue_to => Issue.find(8),
:relation_type => IssueRelation::TYPE_RELATES)
# Validation skipping # Validation skipping
assert IssueRelation.new(:issue_from => Issue.find(8), :issue_to => Issue.find(2), :relation_type => IssueRelation::TYPE_RELATES).save(false) assert IssueRelation.new(:issue_from => Issue.find(8),
assert IssueRelation.new(:issue_from => Issue.find(3), :issue_to => Issue.find(1), :relation_type => IssueRelation::TYPE_RELATES).save(false) :issue_to => Issue.find(2),
:relation_type => IssueRelation::TYPE_RELATES).save(false)
assert IssueRelation.new(:issue_from => Issue.find(3),
:issue_to => Issue.find(1),
:relation_type => IssueRelation::TYPE_RELATES).save(false)
assert_equal [2, 3, 8], Issue.find(1).all_dependent_issues.collect(&:id).sort assert_equal [2, 3, 8], Issue.find(1).all_dependent_issues.collect(&:id).sort
end end