diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-06-05 10:06:17 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-06-05 10:06:17 +0000 |
commit | 79df68e17fc09a4d8bc87cad8efb4bc31c085dcd (patch) | |
tree | 33b0e4d2bfa3e26b6d2fa28a35d91a2b659242c7 /test/functional/roles_controller_test.rb | |
parent | 939a7137ef985647d34fdacadf419b313bcd9110 (diff) | |
download | redmine-79df68e17fc09a4d8bc87cad8efb4bc31c085dcd.tar.gz redmine-79df68e17fc09a4d8bc87cad8efb4bc31c085dcd.zip |
Limit trackers for new issue to certain roles (#7839).
git-svn-id: http://svn.redmine.org/redmine/trunk@15464 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/roles_controller_test.rb')
-rw-r--r-- | test/functional/roles_controller_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/functional/roles_controller_test.rb b/test/functional/roles_controller_test.rb index 8ce469395..915b658c9 100644 --- a/test/functional/roles_controller_test.rb +++ b/test/functional/roles_controller_test.rb @@ -132,6 +132,22 @@ class RolesControllerTest < ActionController::TestCase assert_equal [:edit_project], role.permissions end + def test_update_trackers_permissions + put :update, :id => 1, :role => { + :permissions_all_trackers => {'add_issues' => '0'}, + :permissions_tracker_ids => {'add_issues' => ['1', '3', '']} + } + + assert_redirected_to '/roles' + role = Role.find(1) + + assert_equal({'add_issues' => '0'}, role.permissions_all_trackers) + assert_equal({'add_issues' => ['1', '3']}, role.permissions_tracker_ids) + + assert_equal false, role.permissions_all_trackers?(:add_issues) + assert_equal [1, 3], role.permissions_tracker_ids(:add_issues).sort + end + def test_update_with_failure put :update, :id => 1, :role => {:name => ''} assert_response :success |