mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 23:11:12 +00: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:
parent
e111e2bc38
commit
c7653df32b
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user