diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-07-23 18:18:13 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-07-23 18:18:13 +0000 |
commit | 578fdc62f26c23951b2d2c2b9be0040c7ade0634 (patch) | |
tree | 7f78426f78bdc325cae50368cc1bc3e23f4c5eaa /test/functional/issues_controller_test.rb | |
parent | e1832f25c9aa16f1a95434adc209ee937110228a (diff) | |
download | redmine-578fdc62f26c23951b2d2c2b9be0040c7ade0634.tar.gz redmine-578fdc62f26c23951b2d2c2b9be0040c7ade0634.zip |
Ability to assign issues to groups (#2964).
Option is disabled by default. It can be turned on in application settings.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6306 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/issues_controller_test.rb')
-rw-r--r-- | test/functional/issues_controller_test.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 53afe2a25..3f539faa1 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -535,6 +535,28 @@ class IssuesControllerTest < ActionController::TestCase assert_not_nil v assert_equal 'Value for field 2', v.value end + + def test_post_new_with_group_assignment + group = Group.find(11) + project = Project.find(1) + project.members << Member.new(:principal => group, :roles => [Role.first]) + + with_settings :issue_group_assignment => '1' do + @request.session[:user_id] = 2 + assert_difference 'Issue.count' do + post :create, :project_id => project.id, + :issue => {:tracker_id => 3, + :status_id => 1, + :subject => 'This is the test_new_with_group_assignment issue', + :assigned_to_id => group.id} + end + end + assert_redirected_to :controller => 'issues', :action => 'show', :id => Issue.last.id + + issue = Issue.find_by_subject('This is the test_new_with_group_assignment issue') + assert_not_nil issue + assert_equal group, issue.assigned_to + end def test_post_create_without_start_date @request.session[:user_id] = 2 @@ -1309,6 +1331,22 @@ class IssuesControllerTest < ActionController::TestCase assert_equal 1, journal.details.size end + def test_bulk_update_with_group_assignee + group = Group.find(11) + project = Project.find(1) + project.members << Member.new(:principal => group, :roles => [Role.first]) + + @request.session[:user_id] = 2 + # update issues assignee + post :bulk_update, :ids => [1, 2], :notes => 'Bulk editing', + :issue => {:priority_id => '', + :assigned_to_id => group.id, + :custom_field_values => {'2' => ''}} + + assert_response 302 + assert_equal [group, group], Issue.find_all_by_id([1, 2]).collect {|i| i.assigned_to} + end + def test_bulk_update_on_different_projects @request.session[:user_id] = 2 # update issues priority |