]> source.dussan.org Git - redmine.git/commitdiff
Additional assertions on creation of relations.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 11 Apr 2012 17:27:11 +0000 (17:27 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 11 Apr 2012 17:27:11 +0000 (17:27 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9385 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/issue_relations_controller_test.rb

index 66c482700896304f3cca5092a11df464befd7c3c..36ccf4a9824de25487d8f30d66675fd9246e72cd 100644 (file)
@@ -48,6 +48,10 @@ class IssueRelationsControllerTest < ActionController::TestCase
       post :create, :issue_id => 1,
                  :relation => {:issue_to_id => '2', :relation_type => 'relates', :delay => ''}
     end
+    relation = IssueRelation.first(:order => 'id DESC')
+    assert_equal 1, relation.issue_from_id
+    assert_equal 2, relation.issue_to_id
+    assert_equal 'relates', relation.relation_type
   end
 
   def test_create_xhr
@@ -61,6 +65,9 @@ class IssueRelationsControllerTest < ActionController::TestCase
         assert_select 'tr', 2 # relations
       end
     end
+    relation = IssueRelation.first(:order => 'id DESC')
+    assert_equal 3, relation.issue_from_id
+    assert_equal 1, relation.issue_to_id
   end
 
   def test_create_should_accept_id_with_hash
@@ -69,6 +76,8 @@ class IssueRelationsControllerTest < ActionController::TestCase
       post :create, :issue_id => 1,
                  :relation => {:issue_to_id => '#2', :relation_type => 'relates', :delay => ''}
     end
+    relation = IssueRelation.first(:order => 'id DESC')
+    assert_equal 2, relation.issue_to_id
   end
 
   def test_create_should_strip_id