diff options
author | Go MAEDA <maeda@farend.jp> | 2021-06-02 00:36:17 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2021-06-02 00:36:17 +0000 |
commit | 6ed4d1eb1387af451688f44ff1a1fb2197bc51e1 (patch) | |
tree | af34cd0a6398dc625df15e4990862a0c8a42b31f /test | |
parent | 633c8aaac9956c420f379ac166b11011d4753810 (diff) | |
download | redmine-6ed4d1eb1387af451688f44ff1a1fb2197bc51e1.tar.gz redmine-6ed4d1eb1387af451688f44ff1a1fb2197bc51e1.zip |
Merged r21014 from trunk to 4.2-stable (#35308).
git-svn-id: http://svn.redmine.org/redmine/branches/4.2-stable@21020 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/news_controller_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/news_controller_test.rb b/test/functional/news_controller_test.rb index 4dd46c8a7..212248157 100644 --- a/test/functional/news_controller_test.rb +++ b/test/functional/news_controller_test.rb @@ -53,6 +53,18 @@ class NewsControllerTest < Redmine::ControllerTest assert_response 403 end + def test_index_without_manage_news_permission_should_not_display_add_news_link + user = User.find(2) + @request.session[:user_id] = user.id + Role.all.each {|r| r.remove_permission! :manage_news} + get :index + assert_select '.add-news-link', count: 0 + + user.members.first.roles.first.add_permission! :manage_news + get :index + assert_select '.add-news-link', count: 1 + end + def test_show get(:show, :params => {:id => 1}) assert_response :success |