]> source.dussan.org Git - redmine.git/commitdiff
Merged r12277 (#15344).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 15 Nov 2013 20:32:26 +0000 (20:32 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 15 Nov 2013 20:32:26 +0000 (20:32 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/2.3-stable@12279 e93f8b46-1217-0410-a6f0-8f06a7374b81

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

index fb1c5765f76a4ceaa517416a7bebb39b7922bf28..71c9815a1e62fc6340aeb0f1f3536ab7f440062e 100644 (file)
@@ -410,7 +410,7 @@ class IssuesController < ApplicationController
     @issue.safe_attributes = params[:issue]
 
     @priorities = IssuePriority.active
-    @allowed_statuses = @issue.new_statuses_allowed_to(User.current, true)
+    @allowed_statuses = @issue.new_statuses_allowed_to(User.current, @issue.new_record?)
     @available_watchers = (@issue.project.users.sort + @issue.watcher_users).uniq
   end
 
index 59f7a858a9c75a163d773454a4f73f5d0abe65c6..c5b17f8f796e705b38b8afe120f01f85eac16eed 100644 (file)
@@ -2720,6 +2720,16 @@ class IssuesControllerTest < ActionController::TestCase
     assert_equal 'This is the test_new issue', issue.subject
   end
 
+  def test_update_form_should_propose_default_status_for_existing_issue
+    @request.session[:user_id] = 2
+    WorkflowTransition.delete_all
+    WorkflowTransition.create!(:role_id => 1, :tracker_id => 2, :old_status_id => 2, :new_status_id => 3)
+
+    xhr :put, :update_form, :project_id => 1, :id => 2
+    assert_response :success
+    assert_equal [2,3], assigns(:allowed_statuses).map(&:id).sort
+  end
+
   def test_put_update_without_custom_fields_param
     @request.session[:user_id] = 2
     ActionMailer::Base.deliveries.clear