summaryrefslogtreecommitdiffstats
path: root/test/functional/issue_relations_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-12-05 08:16:29 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-12-05 08:16:29 +0000
commitc7653df32b9c0b6a9b56232b758c49eca2bd7e90 (patch)
tree0f717f001bc1a73f498a64f795889427200eeb6e /test/functional/issue_relations_controller_test.rb
parente111e2bc387e6a73e3b2184e0e3bd9250c0ca608 (diff)
downloadredmine-c7653df32b9c0b6a9b56232b758c49eca2bd7e90.tar.gz
redmine-c7653df32b9c0b6a9b56232b758c49eca2bd7e90.zip
Adds tests for invalid parameters.
git-svn-id: http://svn.redmine.org/redmine/trunk@13707 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/issue_relations_controller_test.rb')
-rw-r--r--test/functional/issue_relations_controller_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/issue_relations_controller_test.rb b/test/functional/issue_relations_controller_test.rb
index 1c6bd2c9a..e364da99c 100644
--- a/test/functional/issue_relations_controller_test.rb
+++ b/test/functional/issue_relations_controller_test.rb
@@ -47,6 +47,14 @@ class IssueRelationsControllerTest < ActionController::TestCase
assert_equal 'relates', relation.relation_type
end
+ def test_create_on_invalid_issue
+ assert_no_difference 'IssueRelation.count' do
+ post :create, :issue_id => 999,
+ :relation => {:issue_to_id => '2', :relation_type => 'relates', :delay => ''}
+ assert_response 404
+ end
+ end
+
def test_create_xhr
assert_difference 'IssueRelation.count' do
xhr :post, :create, :issue_id => 3, :relation => {:issue_to_id => '1', :relation_type => 'relates', :delay => ''}
@@ -127,6 +135,13 @@ class IssueRelationsControllerTest < ActionController::TestCase
end
end
+ def test_destroy_invalid_relation
+ assert_no_difference 'IssueRelation.count' do
+ delete :destroy, :id => '999'
+ assert_response 404
+ end
+ end
+
def test_destroy_xhr
IssueRelation.create!(:relation_type => IssueRelation::TYPE_RELATES) do |r|
r.issue_from_id = 3