]> source.dussan.org Git - redmine.git/commitdiff
Test failure (#23410).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 20 Aug 2016 12:41:24 +0000 (12:41 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 20 Aug 2016 12:41:24 +0000 (12:41 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@15748 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/issues_controller.rb
test/functional/issues_controller_test.rb

index 686a6b47f37a72304f63d5148255da78340be147..d3dd2d5046e8d8f01fdbf0e43610e6a786101b1b 100644 (file)
@@ -151,7 +151,13 @@ class IssuesController < ApplicationController
       return
     else
       respond_to do |format|
-        format.html { render :action => 'new' }
+        format.html {
+          if @issue.project.nil?
+            render_error :status => 422
+          else
+            render :action => 'new'
+          end
+        }
         format.api  { render_validation_errors(@issue) }
       end
     end
@@ -484,7 +490,7 @@ class IssuesController < ApplicationController
         render_error l(:error_no_default_issue_status)
         return false
       end
-    else
+    elsif request.get?
       render_error :message => l(:error_no_projects_with_tracker_allowed_for_new_issue), :status => 403
       return false
     end
index e4c6cd2344d93330f0f38614c2f328b2d7a94011..45605bd9e95d12ad8f99a91e875c5434b567f5af 100644 (file)
@@ -2558,7 +2558,7 @@ class IssuesControllerTest < Redmine::ControllerTest
            :issue => {:project_id => 3,
                       :tracker_id => 2,
                       :subject => 'Foo'}
-      assert_response 403
+      assert_response 422
     end
   end