summaryrefslogtreecommitdiffstats
path: root/test/functional/issue_relations_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-11 17:25:05 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-11 17:25:05 +0000
commit12b71ebc8e9de6ebb8e1bdf96928422f8a63bd81 (patch)
tree169a1f4178332e3d806d4b1f985037816b960020 /test/functional/issue_relations_controller_test.rb
parent04e7b18869eed8824ffd33ebc69dc99e0aab13e0 (diff)
downloadredmine-12b71ebc8e9de6ebb8e1bdf96928422f8a63bd81.tar.gz
redmine-12b71ebc8e9de6ebb8e1bdf96928422f8a63bd81.zip
Strip issue id when adding a relation.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9384 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/issue_relations_controller_test.rb')
-rw-r--r--test/functional/issue_relations_controller_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/issue_relations_controller_test.rb b/test/functional/issue_relations_controller_test.rb
index 19f72b8b8..66c482700 100644
--- a/test/functional/issue_relations_controller_test.rb
+++ b/test/functional/issue_relations_controller_test.rb
@@ -71,6 +71,16 @@ class IssueRelationsControllerTest < ActionController::TestCase
end
end
+ def test_create_should_strip_id
+ assert_difference 'IssueRelation.count' do
+ @request.session[:user_id] = 3
+ 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_not_break_with_non_numerical_id
assert_no_difference 'IssueRelation.count' do
assert_nothing_raised do