summaryrefslogtreecommitdiffstats
path: root/test/unit/role_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-10-20 17:00:04 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-10-20 17:00:04 +0000
commitd8df8c8bcb1e57b231b62ec0513c6c31af556a0c (patch)
tree30054af117a909d642677f440d5d45848277bb12 /test/unit/role_test.rb
parenta2b17dae6e89d348176a601089243c6f42adf2b2 (diff)
downloadredmine-d8df8c8bcb1e57b231b62ec0513c6c31af556a0c.tar.gz
redmine-d8df8c8bcb1e57b231b62ec0513c6c31af556a0c.zip
Role#copy_from should copy managed roles.
git-svn-id: http://svn.redmine.org/redmine/trunk@15913 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/role_test.rb')
-rw-r--r--test/unit/role_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/unit/role_test.rb b/test/unit/role_test.rb
index a04398255..092df322e 100644
--- a/test/unit/role_test.rb
+++ b/test/unit/role_test.rb
@@ -45,6 +45,13 @@ class RoleTest < ActiveSupport::TestCase
assert copy.save
end
+ def test_copy_from_should_copy_managed_roles
+ orig = Role.generate!(:all_roles_managed => false, :managed_role_ids => [2, 3])
+ role = Role.new
+ role.copy_from orig
+ assert_equal [2, 3], role.managed_role_ids.sort
+ end
+
def test_copy_workflows
source = Role.find(1)
rule_count = source.workflow_rules.count