summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-10-20 18:57:44 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-10-20 18:57:44 +0000
commitbf1f60f65fdb4e3cc61f9aa3029f35742f370cb2 (patch)
tree33d35724c65226973326bf4f8fc8f7fb04d2d737 /test
parent540053eb82f0834bd80f49aa86cd034afcdb9c0e (diff)
downloadredmine-bf1f60f65fdb4e3cc61f9aa3029f35742f370cb2.tar.gz
redmine-bf1f60f65fdb4e3cc61f9aa3029f35742f370cb2.zip
Do not clear category on project change if category with same exists (#16941).
git-svn-id: http://svn.redmine.org/redmine/trunk@14715 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/issues_controller_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 9c56b2a24..48ba81485 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -3096,6 +3096,22 @@ class IssuesControllerTest < ActionController::TestCase
assert_equal 'This is the test_new issue', issue.subject
end
+ def test_update_form_should_keep_category_with_same_when_changing_project
+ source = Project.generate!
+ target = Project.generate!
+ source_category = IssueCategory.create!(:name => 'Foo', :project => source)
+ target_category = IssueCategory.create!(:name => 'Foo', :project => target)
+ issue = Issue.generate!(:project => source, :category => source_category)
+
+ @request.session[:user_id] = 1
+ patch :edit, :id => issue.id,
+ :issue => {:project_id => target.id, :category_id => source_category.id}
+ assert_response :success
+
+ issue = assigns(:issue)
+ assert_equal target_category, issue.category
+ end
+
def test_update_form_should_propose_default_status_for_existing_issue
@request.session[:user_id] = 2
WorkflowTransition.delete_all