diff options
author | Mark Chao <mchao@gitlab.com> | 2019-11-14 09:44:39 +0300 |
---|---|---|
committer | Mark Chao <mchao@gitlab.com> | 2019-11-22 13:14:07 +0300 |
commit | 60942bef145b0e416fcf61b84ad21828caa933a2 (patch) | |
tree | 9e06e6e461316fb466af95b318d86221cce72243 | |
parent | 443db2868d899b9a41e85766d78d1c4203c4cb1f (diff) |
Test admin for search accessibility
Disabled features are ignored as they are grey areas
-rw-r--r-- | spec/support/helpers/project_helpers.rb | 2 | ||||
-rw-r--r-- | spec/support/shared_contexts/policies/project_policy_table_shared_context.rb | 34 |
2 files changed, 36 insertions, 0 deletions
diff --git a/spec/support/helpers/project_helpers.rb b/spec/support/helpers/project_helpers.rb index 3cc84d935d2..89f0163b4b6 100644 --- a/spec/support/helpers/project_helpers.rb +++ b/spec/support/helpers/project_helpers.rb @@ -10,6 +10,8 @@ module ProjectHelpers nil when :non_member create(:user, name: membership) + when :admin + create(:user, :admin, name: 'admin') else create(:user, name: membership).tap { |u| target.add_user(u, membership) } end diff --git a/spec/support/shared_contexts/policies/project_policy_table_shared_context.rb b/spec/support/shared_contexts/policies/project_policy_table_shared_context.rb index 2ca8c8d739c..0a918ccde81 100644 --- a/spec/support/shared_contexts/policies/project_policy_table_shared_context.rb +++ b/spec/support/shared_contexts/policies/project_policy_table_shared_context.rb @@ -18,11 +18,13 @@ RSpec.shared_context 'ProjectPolicyTable context' do # rubocop:disable Metrics/AbcSize # project_level, :feature_access_level, :membership, :expected_count def permission_table_for_reporter_feature_access + :public | :enabled | :admin | 1 :public | :enabled | :reporter | 1 :public | :enabled | :guest | 1 :public | :enabled | :non_member | 1 :public | :enabled | :anonymous | 1 + :public | :private | :admin | 1 :public | :private | :reporter | 1 :public | :private | :guest | 0 :public | :private | :non_member | 0 @@ -33,11 +35,13 @@ RSpec.shared_context 'ProjectPolicyTable context' do :public | :disabled | :non_member | 0 :public | :disabled | :anonymous | 0 + :internal | :enabled | :admin | 1 :internal | :enabled | :reporter | 1 :internal | :enabled | :guest | 1 :internal | :enabled | :non_member | 1 :internal | :enabled | :anonymous | 0 + :internal | :private | :admin | 1 :internal | :private | :reporter | 1 :internal | :private | :guest | 0 :internal | :private | :non_member | 0 @@ -48,6 +52,7 @@ RSpec.shared_context 'ProjectPolicyTable context' do :internal | :disabled | :non_member | 0 :internal | :disabled | :anonymous | 0 + :private | :private | :admin | 1 :private | :private | :reporter | 1 :private | :private | :guest | 0 :private | :private | :non_member | 0 @@ -61,11 +66,13 @@ RSpec.shared_context 'ProjectPolicyTable context' do # project_level, :feature_access_level, :membership, :expected_count def permission_table_for_guest_feature_access + :public | :enabled | :admin | 1 :public | :enabled | :reporter | 1 :public | :enabled | :guest | 1 :public | :enabled | :non_member | 1 :public | :enabled | :anonymous | 1 + :public | :private | :admin | 1 :public | :private | :reporter | 1 :public | :private | :guest | 1 :public | :private | :non_member | 0 @@ -76,11 +83,13 @@ RSpec.shared_context 'ProjectPolicyTable context' do :public | :disabled | :non_member | 0 :public | :disabled | :anonymous | 0 + :internal | :enabled | :admin | 1 :internal | :enabled | :reporter | 1 :internal | :enabled | :guest | 1 :internal | :enabled | :non_member | 1 :internal | :enabled | :anonymous | 0 + :internal | :private | :admin | 1 :internal | :private | :reporter | 1 :internal | :private | :guest | 1 :internal | :private | :non_member | 0 @@ -91,6 +100,7 @@ RSpec.shared_context 'ProjectPolicyTable context' do :internal | :disabled | :non_member | 0 :internal | :disabled | :anonymous | 0 + :private | :private | :admin | 1 :private | :private | :reporter | 1 :private | :private | :guest | 1 :private | :private | :non_member | 0 @@ -113,11 +123,13 @@ RSpec.shared_context 'ProjectPolicyTable context' do # # project_level, :feature_access_level, :membership, :expected_count def permission_table_for_guest_feature_access_and_non_private_project_only + :public | :enabled | :admin | 1 :public | :enabled | :reporter | 1 :public | :enabled | :guest | 1 :public | :enabled | :non_member | 1 :public | :enabled | :anonymous | 1 + :public | :private | :admin | 1 :public | :private | :reporter | 1 :public | :private | :guest | 1 :public | :private | :non_member | 0 @@ -128,11 +140,13 @@ RSpec.shared_context 'ProjectPolicyTable context' do :public | :disabled | :non_member | 0 :public | :disabled | :anonymous | 0 + :internal | :enabled | :admin | 1 :internal | :enabled | :reporter | 1 :internal | :enabled | :guest | 1 :internal | :enabled | :non_member | 1 :internal | :enabled | :anonymous | 0 + :internal | :private | :admin | 1 :internal | :private | :reporter | 1 :internal | :private | :guest | 1 :internal | :private | :non_member | 0 @@ -143,6 +157,7 @@ RSpec.shared_context 'ProjectPolicyTable context' do :internal | :disabled | :non_member | 0 :internal | :disabled | :anonymous | 0 + :private | :private | :admin | 1 :private | :private | :reporter | 1 :private | :private | :guest | 0 :private | :private | :non_member | 0 @@ -156,41 +171,49 @@ RSpec.shared_context 'ProjectPolicyTable context' do # :project_level, :issues_access_level, :merge_requests_access_level, :membership, :expected_count def permission_table_for_milestone_access + :public | :enabled | :enabled | :admin | 1 :public | :enabled | :enabled | :reporter | 1 :public | :enabled | :enabled | :guest | 1 :public | :enabled | :enabled | :non_member | 1 :public | :enabled | :enabled | :anonymous | 1 + :public | :enabled | :private | :admin | 1 :public | :enabled | :private | :reporter | 1 :public | :enabled | :private | :guest | 1 :public | :enabled | :private | :non_member | 1 :public | :enabled | :private | :anonymous | 1 + :public | :enabled | :disabled | :admin | 1 :public | :enabled | :disabled | :reporter | 1 :public | :enabled | :disabled | :guest | 1 :public | :enabled | :disabled | :non_member | 1 :public | :enabled | :disabled | :anonymous | 1 + :public | :private | :enabled | :admin | 1 :public | :private | :enabled | :reporter | 1 :public | :private | :enabled | :guest | 1 :public | :private | :enabled | :non_member | 1 :public | :private | :enabled | :anonymous | 1 + :public | :private | :private | :admin | 1 :public | :private | :private | :reporter | 1 :public | :private | :private | :guest | 1 :public | :private | :private | :non_member | 0 :public | :private | :private | :anonymous | 0 + :public | :private | :disabled | :admin | 1 :public | :private | :disabled | :reporter | 1 :public | :private | :disabled | :guest | 1 :public | :private | :disabled | :non_member | 0 :public | :private | :disabled | :anonymous | 0 + :public | :disabled | :enabled | :admin | 1 :public | :disabled | :enabled | :reporter | 1 :public | :disabled | :enabled | :guest | 1 :public | :disabled | :enabled | :non_member | 1 :public | :disabled | :enabled | :anonymous | 1 + :public | :disabled | :private | :admin | 1 :public | :disabled | :private | :reporter | 1 :public | :disabled | :private | :guest | 0 :public | :disabled | :private | :non_member | 0 @@ -201,41 +224,49 @@ RSpec.shared_context 'ProjectPolicyTable context' do :public | :disabled | :disabled | :non_member | 0 :public | :disabled | :disabled | :anonymous | 0 + :internal | :enabled | :enabled | :admin | 1 :internal | :enabled | :enabled | :reporter | 1 :internal | :enabled | :enabled | :guest | 1 :internal | :enabled | :enabled | :non_member | 1 :internal | :enabled | :enabled | :anonymous | 0 + :internal | :enabled | :private | :admin | 1 :internal | :enabled | :private | :reporter | 1 :internal | :enabled | :private | :guest | 1 :internal | :enabled | :private | :non_member | 1 :internal | :enabled | :private | :anonymous | 0 + :internal | :enabled | :disabled | :admin | 1 :internal | :enabled | :disabled | :reporter | 1 :internal | :enabled | :disabled | :guest | 1 :internal | :enabled | :disabled | :non_member | 1 :internal | :enabled | :disabled | :anonymous | 0 + :internal | :private | :enabled | :admin | 1 :internal | :private | :enabled | :reporter | 1 :internal | :private | :enabled | :guest | 1 :internal | :private | :enabled | :non_member | 1 :internal | :private | :enabled | :anonymous | 0 + :internal | :private | :private | :admin | 1 :internal | :private | :private | :reporter | 1 :internal | :private | :private | :guest | 1 :internal | :private | :private | :non_member | 0 :internal | :private | :private | :anonymous | 0 + :internal | :private | :disabled | :admin | 1 :internal | :private | :disabled | :reporter | 1 :internal | :private | :disabled | :guest | 1 :internal | :private | :disabled | :non_member | 0 :internal | :private | :disabled | :anonymous | 0 + :internal | :disabled | :enabled | :admin | 1 :internal | :disabled | :enabled | :reporter | 1 :internal | :disabled | :enabled | :guest | 1 :internal | :disabled | :enabled | :non_member | 1 :internal | :disabled | :enabled | :anonymous | 0 + :internal | :disabled | :private | :admin | 1 :internal | :disabled | :private | :reporter | 1 :internal | :disabled | :private | :guest | 0 :internal | :disabled | :private | :non_member | 0 @@ -246,16 +277,19 @@ RSpec.shared_context 'ProjectPolicyTable context' do :internal | :disabled | :disabled | :non_member | 0 :internal | :disabled | :disabled | :anonymous | 0 + :private | :private | :private | :admin | 1 :private | :private | :private | :reporter | 1 :private | :private | :private | :guest | 1 :private | :private | :private | :non_member | 0 :private | :private | :private | :anonymous | 0 + :private | :private | :disabled | :admin | 1 :private | :private | :disabled | :reporter | 1 :private | :private | :disabled | :guest | 1 :private | :private | :disabled | :non_member | 0 :private | :private | :disabled | :anonymous | 0 + :private | :disabled | :private | :admin | 1 :private | :disabled | :private | :reporter | 1 :private | :disabled | :private | :guest | 0 :private | :disabled | :private | :non_member | 0 |