summaryrefslogtreecommitdiffstats
path: root/test/functional/issues_controller_test.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2022-01-10 07:11:14 +0000
committerGo MAEDA <maeda@farend.jp>2022-01-10 07:11:14 +0000
commit873580ca74a392ca3f8cec78b214f8c70f5d6f17 (patch)
tree66d2a51955543b5679f311f327ebdfa70b9375e2 /test/functional/issues_controller_test.rb
parenta68a1875405fd79b8614d73c61449d25bd63efd5 (diff)
downloadredmine-873580ca74a392ca3f8cec78b214f8c70f5d6f17.tar.gz
redmine-873580ca74a392ca3f8cec78b214f8c70f5d6f17.zip
Permission check of the setting button on the issues page mismatches button semantics (#35090).
Patch by Takenori TAKAKI. git-svn-id: http://svn.redmine.org/redmine/trunk@21357 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/issues_controller_test.rb')
-rw-r--r--test/functional/issues_controller_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 8074ca3f2..2af871d54 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -2005,6 +2005,22 @@ class IssuesControllerTest < Redmine::ControllerTest
assert_select '#content a.new-issue[href="/issues/new"]', :text => 'New issue'
end
+ def test_index_should_show_setting_link_with_edit_project_permission
+ role = Role.find(1)
+ role.add_permission! :edit_project
+ @request.session[:user_id] = 2
+ get(:index, :params => {:project_id => 1})
+ assert_select '#content a.icon-settings[href="/projects/ecookbook/settings/issues"]', 1
+ end
+
+ def test_index_should_not_show_setting_link_without_edit_project_permission
+ role = Role.find(1)
+ role.remove_permission! :edit_project
+ @request.session[:user_id] = 2
+ get(:index, :params => {:project_id => 1})
+ assert_select '#content a.icon-settings[href="/projects/ecookbook/settings/issues"]', 0
+ end
+
def test_index_should_not_include_new_issue_tab_when_disabled
with_settings :new_item_menu_tab => '0' do
@request.session[:user_id] = 2