summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-04-11 07:09:11 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-04-11 07:09:11 +0000
commit11e8dc263f9ab8316ed152c2ff6715068cd31c14 (patch)
tree7cb0bb6f1aec2c3335d1efcab28e08c2bd241df4 /test/functional
parentb88cac254e9768012789c9dbb929cc7256ad516d (diff)
downloadredmine-11e8dc263f9ab8316ed152c2ff6715068cd31c14.tar.gz
redmine-11e8dc263f9ab8316ed152c2ff6715068cd31c14.zip
When create by copying the issue, status can not be changed to default (#19553).
git-svn-id: http://svn.redmine.org/redmine/trunk@14158 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/issues_controller_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 7685dc127..33a85540e 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -2605,6 +2605,20 @@ class IssuesControllerTest < ActionController::TestCase
assert_equal 'Copy', issue.subject
end
+ def test_create_as_copy_should_allow_status_to_be_set_to_default
+ copied = Issue.generate! :status_id => 2
+ assert_equal 2, copied.reload.status_id
+
+ @request.session[:user_id] = 2
+ assert_difference 'Issue.count' do
+ post :create, :project_id => 1, :copy_from => copied.id,
+ :issue => {:project_id => '1', :tracker_id => '1', :status_id => '1'},
+ :was_default_status => '1'
+ end
+ issue = Issue.order('id DESC').first
+ assert_equal 1, issue.status_id
+ end
+
def test_create_as_copy_should_copy_attachments
@request.session[:user_id] = 2
issue = Issue.find(3)