summaryrefslogtreecommitdiffstats
path: root/test
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
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')
-rw-r--r--test/functional/roles_controller_test.rb2
-rw-r--r--test/unit/role_test.rb7
2 files changed, 8 insertions, 1 deletions
diff --git a/test/functional/roles_controller_test.rb b/test/functional/roles_controller_test.rb
index 88bb46826..c6f19b87b 100644
--- a/test/functional/roles_controller_test.rb
+++ b/test/functional/roles_controller_test.rb
@@ -129,7 +129,7 @@ class RolesControllerTest < Redmine::ControllerTest
assert_response 302
end
assert_equal false, role.all_roles_managed
- assert_equal [2, 3], role.managed_role_ids
+ assert_equal [2, 3], role.managed_role_ids.sort
end
def test_edit
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