summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2019-03-15 09:37:04 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2019-03-15 09:37:04 +0000
commit7a11864812f790df7ffbf6ef61c9818caedae027 (patch)
tree99bfda5c4dd80f6a1b4b40b3d0abd6e561ce8964 /test/functional
parent9f24ceb6b3facdac5ae5cb3782779ca00465f991 (diff)
downloadredmine-7a11864812f790df7ffbf6ef61c9818caedae027.tar.gz
redmine-7a11864812f790df7ffbf6ef61c9818caedae027.zip
Support issue[assigned_to_id]=me when prefilling issues (#28502).
Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@17964 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/issues_controller_test.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 1d11eac73..30ecd3073 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -2552,6 +2552,17 @@ class IssuesControllerTest < Redmine::ControllerTest
end
end
+ def test_new_with_me_assigned_to_id
+ @request.session[:user_id] = 2
+ get :new, :params => {
+ :issue => { :assigned_to_id => 'me' }
+ }
+ assert_response :success
+ assert_select 'select[name=?]', 'issue[assigned_to_id]' do
+ assert_select 'option[value="2"][selected=selected]'
+ end
+ end
+
def test_new_should_select_default_status
@request.session[:user_id] = 2
@@ -4579,6 +4590,18 @@ class IssuesControllerTest < Redmine::ControllerTest
end
end
+ def test_get_edit_with_me_assigned_to_id
+ @request.session[:user_id] = 2
+ get :edit, :params => {
+ :id => 1,
+ :issue => { :assigned_to_id => 'me' }
+ }
+ assert_response :success
+ assert_select 'select[name=?]', 'issue[assigned_to_id]' do
+ assert_select 'option[value="2"][selected=selected]'
+ end
+ end
+
def test_update_form_for_existing_issue
@request.session[:user_id] = 2
patch :edit, :params => {
@@ -5395,6 +5418,20 @@ class IssuesControllerTest < Redmine::ControllerTest
assert_equal 'Original subject', issue.reload.subject
end
+ def test_update_with_me_assigned_to_id
+ @request.session[:user_id] = 2
+ issue = Issue.find(1)
+ assert_not_equal 2, issue.assigned_to_id
+ put :update, :params => {
+ :id => issue.id,
+ :issue => {
+ :assigned_to_id => 'me'
+ }
+ }
+ assert_response 302
+ assert_equal 2, issue.reload.assigned_to_id
+ end
+
def test_get_bulk_edit
@request.session[:user_id] = 2
get :bulk_edit, :params => {