diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-10-09 11:02:56 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-10-09 11:02:56 +0000 |
commit | 178f64950f89139279a98794264862c9a5ea7110 (patch) | |
tree | 0a84b4d1f0929fca56f6e8a13107a5270421cff9 /test/unit/issue_relation_test.rb | |
parent | 727aad50b7a47a3169fdfcdb0540d71b3abe1a88 (diff) | |
download | redmine-178f64950f89139279a98794264862c9a5ea7110.tar.gz redmine-178f64950f89139279a98794264862c9a5ea7110.zip |
code layout cleanup test/unit/issue_relation_test.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10573 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_relation_test.rb')
-rw-r--r-- | test/unit/issue_relation_test.rb | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/test/unit/issue_relation_test.rb b/test/unit/issue_relation_test.rb index d341fea00..d333e1bf3 100644 --- a/test/unit/issue_relation_test.rb +++ b/test/unit/issue_relation_test.rb @@ -99,18 +99,36 @@ class IssueRelationTest < ActiveSupport::TestCase def test_validates_circular_dependency IssueRelation.delete_all - assert IssueRelation.create!(:issue_from => Issue.find(1), :issue_to => Issue.find(2), :relation_type => IssueRelation::TYPE_PRECEDES) - assert IssueRelation.create!(:issue_from => Issue.find(2), :issue_to => Issue.find(3), :relation_type => IssueRelation::TYPE_PRECEDES) - r = IssueRelation.new(:issue_from => Issue.find(3), :issue_to => Issue.find(1), :relation_type => IssueRelation::TYPE_PRECEDES) + assert IssueRelation.create!( + :issue_from => Issue.find(1), :issue_to => Issue.find(2), + :relation_type => IssueRelation::TYPE_PRECEDES + ) + assert IssueRelation.create!( + :issue_from => Issue.find(2), :issue_to => Issue.find(3), + :relation_type => IssueRelation::TYPE_PRECEDES + ) + r = IssueRelation.new( + :issue_from => Issue.find(3), :issue_to => Issue.find(1), + :relation_type => IssueRelation::TYPE_PRECEDES + ) assert !r.save assert_not_nil r.errors[:base] end def test_validates_circular_dependency_on_reverse_relations IssueRelation.delete_all - assert IssueRelation.create!(:issue_from => Issue.find(1), :issue_to => Issue.find(3), :relation_type => IssueRelation::TYPE_BLOCKS) - assert IssueRelation.create!(:issue_from => Issue.find(1), :issue_to => Issue.find(2), :relation_type => IssueRelation::TYPE_BLOCKED) - r = IssueRelation.new(:issue_from => Issue.find(2), :issue_to => Issue.find(1), :relation_type => IssueRelation::TYPE_BLOCKED) + assert IssueRelation.create!( + :issue_from => Issue.find(1), :issue_to => Issue.find(3), + :relation_type => IssueRelation::TYPE_BLOCKS + ) + assert IssueRelation.create!( + :issue_from => Issue.find(1), :issue_to => Issue.find(2), + :relation_type => IssueRelation::TYPE_BLOCKED + ) + r = IssueRelation.new( + :issue_from => Issue.find(2), :issue_to => Issue.find(1), + :relation_type => IssueRelation::TYPE_BLOCKED + ) assert !r.save assert_not_nil r.errors[:base] end |