summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_relation_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-12-18 20:59:30 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-12-18 20:59:30 +0000
commit77aeca5d555b87e37a4cf290e6f3fcf9ad5151e1 (patch)
tree568f2fbe76659b8044bb85dc3b57dbcdf60bebe8 /test/unit/issue_relation_test.rb
parentbeb20e7c6e906b1b5c892841c1948cb50df86e3e (diff)
downloadredmine-77aeca5d555b87e37a4cf290e6f3fcf9ad5151e1.tar.gz
redmine-77aeca5d555b87e37a4cf290e6f3fcf9ad5151e1.zip
Fixes 'follows' relation validation.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3191 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_relation_test.rb')
-rw-r--r--test/unit/issue_relation_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/issue_relation_test.rb b/test/unit/issue_relation_test.rb
index cba105e73..92316dede 100644
--- a/test/unit/issue_relation_test.rb
+++ b/test/unit/issue_relation_test.rb
@@ -43,4 +43,15 @@ class IssueRelationTest < ActiveSupport::TestCase
assert_equal to, relation.issue_from
assert_equal from, relation.issue_to
end
+
+ def test_follows_relation_should_not_be_reversed_if_validation_fails
+ from = Issue.find(1)
+ to = Issue.find(2)
+
+ relation = IssueRelation.new :issue_from => from, :issue_to => to, :relation_type => IssueRelation::TYPE_FOLLOWS, :delay => 'xx'
+ assert !relation.save
+ assert_equal IssueRelation::TYPE_FOLLOWS, relation.relation_type
+ assert_equal from, relation.issue_from
+ assert_equal to, relation.issue_to
+ end
end