summaryrefslogtreecommitdiffstats
path: root/test/functional/roles_controller_test.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-02-24 15:36:25 +0000
committerGo MAEDA <maeda@farend.jp>2019-02-24 15:36:25 +0000
commit554a09af503a430dc89b9d4635539007c0cb50a5 (patch)
tree895cc0a6eb60b135fe22d4a9ca8dfba6b85793a8 /test/functional/roles_controller_test.rb
parentd7c0a2bc5343a5017f4d0ca4eb428cdb3303fa8a (diff)
downloadredmine-554a09af503a430dc89b9d4635539007c0cb50a5.tar.gz
redmine-554a09af503a430dc89b9d4635539007c0cb50a5.zip
Show warning when no workflow is defined for the role (#30853).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@17899 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/roles_controller_test.rb')
-rw-r--r--test/functional/roles_controller_test.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/functional/roles_controller_test.rb b/test/functional/roles_controller_test.rb
index 07167e8be..f401d51d9 100644
--- a/test/functional/roles_controller_test.rb
+++ b/test/functional/roles_controller_test.rb
@@ -35,6 +35,24 @@ class RolesControllerTest < Redmine::ControllerTest
end
end
+ def test_index_should_show_warning_when_no_workflow_is_defined
+ Role.find_by_name('Developer').workflow_rules.destroy_all
+ Role.find_by_name('Anonymous').workflow_rules.destroy_all
+
+ get :index
+ assert_response :success
+ assert_select 'table.roles' do
+ # Manager
+ assert_select 'tr.givable:nth-of-type(1) span.icon-warning', :count => 0
+ # Developer
+ assert_select 'tr.givable:nth-of-type(2) span.icon-warning', :text => /#{I18n.t(:text_role_no_workflow)}/
+ # Reporter
+ assert_select 'tr.givable:nth-of-type(3) span.icon-warning', :count => 0
+ # No warnings for built-in roles such as Anonymous and Non-member
+ assert_select 'tr.builtin span.icon-warning', :count => 0
+ end
+ end
+
def test_new
get :new
assert_response :success