mirror of
https://github.com/redmine/redmine.git
synced 2025-11-09 14:56:01 +01:00
Updating an issue via REST API causes internal server error if invalid project id is specified (#33417).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@19777 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -663,6 +663,34 @@ class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
|
||||
assert_response 422
|
||||
end
|
||||
|
||||
test "POST /issues.json with invalid project_id and any assigned_to_id should respond with 422" do
|
||||
post(
|
||||
'/issues.json',
|
||||
:params => {
|
||||
:issue => {
|
||||
:project_id => 999,
|
||||
:assigned_to_id => 1,
|
||||
:subject => 'API'
|
||||
}
|
||||
},
|
||||
:headers => credentials('jsmith'))
|
||||
assert_response 422
|
||||
end
|
||||
|
||||
test "POST /issues.json with invalid project_id and any fixed_version_id should respond with 422" do
|
||||
post(
|
||||
'/issues.json',
|
||||
:params => {
|
||||
:issue => {
|
||||
:project_id => 999,
|
||||
:fixed_version_id => 1,
|
||||
:subject => 'API'
|
||||
}
|
||||
},
|
||||
:headers => credentials('jsmith'))
|
||||
assert_response 422
|
||||
end
|
||||
|
||||
test "PUT /issues/:id.xml" do
|
||||
assert_difference('Journal.count') do
|
||||
put(
|
||||
|
||||
Reference in New Issue
Block a user