@@ -149,7 +149,7 class IssuesController < ApplicationController | |||
|
149 | 149 | if request.get? || request.xhr? |
|
150 | 150 | @issue.start_date ||= Date.today |
|
151 | 151 | else |
|
152 | requested_status = IssueStatus.find_by_id(params[:issue][:status_id]) | |
|
152 | requested_status = IssueStatus.find_by_id(params[:issue][:status_id]) if params[:issue] | |
|
153 | 153 | # Check that the user is allowed to apply the requested status |
|
154 | 154 | @issue.status = (@allowed_statuses.include? requested_status) ? requested_status : default_status |
|
155 | 155 | call_hook(:controller_issues_new_before_save, { :params => params, :issue => @issue }) |
@@ -649,6 +649,12 class IssuesControllerTest < ActionController::TestCase | |||
|
649 | 649 | :value => 'Value for field 2'} |
|
650 | 650 | end |
|
651 | 651 | |
|
652 | test "POST new with no issue params" do | |
|
653 | @request.session[:user_id] = 2 | |
|
654 | post :new, :project_id => 1 | |
|
655 | assert_response :success | |
|
656 | end | |
|
657 | ||
|
652 | 658 | def test_copy_routing |
|
653 | 659 | assert_routing( |
|
654 | 660 | {:method => :get, :path => '/projects/world_domination/issues/567/copy'}, |
General Comments 0
You need to be logged in to leave comments.
Login now