##// END OF EJS Templates
Fix nil method error when no issue params are submitted. #5123...
Eric Davis -
r3682:e7790bb6b5a9
parent child
Show More
@@ -149,7 +149,7 class IssuesController < ApplicationController
149 if request.get? || request.xhr?
149 if request.get? || request.xhr?
150 @issue.start_date ||= Date.today
150 @issue.start_date ||= Date.today
151 else
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 # Check that the user is allowed to apply the requested status
153 # Check that the user is allowed to apply the requested status
154 @issue.status = (@allowed_statuses.include? requested_status) ? requested_status : default_status
154 @issue.status = (@allowed_statuses.include? requested_status) ? requested_status : default_status
155 call_hook(:controller_issues_new_before_save, { :params => params, :issue => @issue })
155 call_hook(:controller_issues_new_before_save, { :params => params, :issue => @issue })
@@ -649,6 +649,12 class IssuesControllerTest < ActionController::TestCase
649 :value => 'Value for field 2'}
649 :value => 'Value for field 2'}
650 end
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 def test_copy_routing
658 def test_copy_routing
653 assert_routing(
659 assert_routing(
654 {:method => :get, :path => '/projects/world_domination/issues/567/copy'},
660 {:method => :get, :path => '/projects/world_domination/issues/567/copy'},
General Comments 0
You need to be logged in to leave comments. Login now