mirror of
https://github.com/redmine/redmine.git
synced 2025-11-07 13:55:52 +01:00
Adds tests for invalid parameters.
git-svn-id: http://svn.redmine.org/redmine/trunk@13707 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -47,6 +47,14 @@ class IssueRelationsControllerTest < ActionController::TestCase
|
|||||||
assert_equal 'relates', relation.relation_type
|
assert_equal 'relates', relation.relation_type
|
||||||
end
|
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
|
def test_create_xhr
|
||||||
assert_difference 'IssueRelation.count' do
|
assert_difference 'IssueRelation.count' do
|
||||||
xhr :post, :create, :issue_id => 3, :relation => {:issue_to_id => '1', :relation_type => 'relates', :delay => ''}
|
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
|
||||||
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
|
def test_destroy_xhr
|
||||||
IssueRelation.create!(:relation_type => IssueRelation::TYPE_RELATES) do |r|
|
IssueRelation.create!(:relation_type => IssueRelation::TYPE_RELATES) do |r|
|
||||||
r.issue_from_id = 3
|
r.issue_from_id = 3
|
||||||
|
|||||||
Reference in New Issue
Block a user