@@ -398,7 +398,7 private | |||
|
398 | 398 | end |
|
399 | 399 | |
|
400 | 400 | @issue.project = @project |
|
401 | @issue.author = User.current | |
|
401 | @issue.author ||= User.current | |
|
402 | 402 | # Tracker must be set before custom field values |
|
403 | 403 | @issue.tracker ||= @project.trackers.find((params[:issue] && params[:issue][:tracker_id]) || params[:tracker_id] || :first) |
|
404 | 404 | if @issue.tracker.nil? |
@@ -2521,6 +2521,18 class IssuesControllerTest < ActionController::TestCase | |||
|
2521 | 2521 | assert_equal 'This is the test_new issue', issue.subject |
|
2522 | 2522 | end |
|
2523 | 2523 | |
|
2524 | def test_update_edit_form_should_keep_issue_author | |
|
2525 | @request.session[:user_id] = 3 | |
|
2526 | xhr :put, :new, :project_id => 1, :id => 1, :issue => {:subject => 'Changed'} | |
|
2527 | assert_response :success | |
|
2528 | assert_equal 'text/javascript', response.content_type | |
|
2529 | ||
|
2530 | issue = assigns(:issue) | |
|
2531 | assert_equal User.find(2), issue.author | |
|
2532 | assert_equal 2, issue.author_id | |
|
2533 | assert_not_equal User.current, issue.author | |
|
2534 | end | |
|
2535 | ||
|
2524 | 2536 | def test_update_edit_form_should_propose_transitions_based_on_initial_status |
|
2525 | 2537 | @request.session[:user_id] = 2 |
|
2526 | 2538 | WorkflowTransition.delete_all |
General Comments 0
You need to be logged in to leave comments.
Login now