@@ -237,7 +237,7 class Issue < ActiveRecord::Base | |||
|
237 | 237 | if !user.allowed_to?(:manage_subtasks, project) |
|
238 | 238 | attrs.delete('parent_issue_id') |
|
239 | 239 | elsif !attrs['parent_issue_id'].blank? |
|
240 | attrs.delete('parent_issue_id') unless Issue.visible(user).exists?(attrs['parent_issue_id']) | |
|
240 | attrs.delete('parent_issue_id') unless Issue.visible(user).exists?(attrs['parent_issue_id'].to_i) | |
|
241 | 241 | end |
|
242 | 242 | end |
|
243 | 243 |
@@ -498,6 +498,20 class IssuesControllerTest < ActionController::TestCase | |||
|
498 | 498 | assert_not_nil issue |
|
499 | 499 | assert_equal Issue.find(2), issue.parent |
|
500 | 500 | end |
|
501 | ||
|
502 | def test_post_create_subissue_with_non_numeric_parent_id | |
|
503 | @request.session[:user_id] = 2 | |
|
504 | ||
|
505 | assert_difference 'Issue.count' do | |
|
506 | post :create, :project_id => 1, | |
|
507 | :issue => {:tracker_id => 1, | |
|
508 | :subject => 'This is a child issue', | |
|
509 | :parent_issue_id => 'ABC'} | |
|
510 | end | |
|
511 | issue = Issue.find_by_subject('This is a child issue') | |
|
512 | assert_not_nil issue | |
|
513 | assert_nil issue.parent | |
|
514 | end | |
|
501 | 515 | |
|
502 | 516 | def test_post_create_should_send_a_notification |
|
503 | 517 | ActionMailer::Base.deliveries.clear |
General Comments 0
You need to be logged in to leave comments.
Login now