]> source.dussan.org Git - redmine.git/commitdiff
Tests for r17359 (#28693).
authorGo MAEDA <maeda@farend.jp>
Sun, 3 Jun 2018 01:25:18 +0000 (01:25 +0000)
committerGo MAEDA <maeda@farend.jp>
Sun, 3 Jun 2018 01:25:18 +0000 (01:25 +0000)
Patch by Mizuki ISHIKAWA.

git-svn-id: http://svn.redmine.org/redmine/trunk@17360 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/projects_controller_test.rb

index 77480894a4f92cb7910a21db2dfc75a5cfa42b0d..201473980227eb7224d3afb542dac48969eab038 100644 (file)
@@ -656,6 +656,28 @@ class ProjectsControllerTest < Redmine::ControllerTest
     assert_select "tr#member-#{member.id}"
   end
 
+  def test_settings_should_show_tabs_depending_on_permission
+    @request.session[:user_id] = 3
+    role = User.find(3).roles.first
+
+    role.permissions = []
+    role.save
+    get :settings, :params => {
+      :id => 'ecookbook'
+    }
+    assert_response 403
+
+    role.add_permission! :manage_repository, :manage_boards, :manage_project_activities
+    get :settings, :params => {
+      :id => 'ecookbook'
+    }
+    assert_response :success
+    assert_select 'a[id^=tab-]', 3
+    assert_select 'a#tab-repositories'
+    assert_select 'a#tab-boards'
+    assert_select 'a#tab-activities'
+  end
+
   def test_update
     @request.session[:user_id] = 2 # manager
     post :update, :params => {