summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/role.rb1
-rw-r--r--test/functional/roles_controller_test.rb15
2 files changed, 16 insertions, 0 deletions
diff --git a/app/models/role.rb b/app/models/role.rb
index a307a51f6..c77412e88 100644
--- a/app/models/role.rb
+++ b/app/models/role.rb
@@ -98,6 +98,7 @@ class Role < ActiveRecord::Base
'users_visibility',
'time_entries_visibility',
'all_roles_managed',
+ 'managed_role_ids',
'permissions',
'permissions_all_trackers',
'permissions_tracker_ids'
diff --git a/test/functional/roles_controller_test.rb b/test/functional/roles_controller_test.rb
index ea2ccb018..88bb46826 100644
--- a/test/functional/roles_controller_test.rb
+++ b/test/functional/roles_controller_test.rb
@@ -117,6 +117,21 @@ class RolesControllerTest < Redmine::ControllerTest
assert_equal Role.find(1).workflow_rules.size, role.workflow_rules.size
end
+ def test_create_with_managed_roles
+ role = new_record(Role) do
+ post :create, :params => {
+ :role => {
+ :name => 'Role',
+ :all_roles_managed => '0',
+ :managed_role_ids => ['2', '3', '']
+ }
+ }
+ assert_response 302
+ end
+ assert_equal false, role.all_roles_managed
+ assert_equal [2, 3], role.managed_role_ids
+ end
+
def test_edit
get :edit, :params => {:id => 1}
assert_response :success