diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-01 15:10:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-01 15:10:15 +0300 |
commit | cf19a51fc5711144b26f7123c14f9b64a7597195 (patch) | |
tree | 09c151fd3655213e87b1c25beb842a99510122cb /spec/policies | |
parent | 3b1df712c7a15c9b6abadd61e9c8894fdeb0442a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/policies')
-rw-r--r-- | spec/policies/project_policy_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/policies/project_policy_spec.rb b/spec/policies/project_policy_spec.rb index d07a4e9f207..ee8d811971a 100644 --- a/spec/policies/project_policy_spec.rb +++ b/spec/policies/project_policy_spec.rb @@ -3283,6 +3283,32 @@ RSpec.describe ProjectPolicy, feature_category: :system_access do end end + describe ':read_model_experiments' do + using RSpec::Parameterized::TableSyntax + + where(:ff_ml_experiment_tracking, :current_user, :access_level, :allowed) do + false | ref(:owner) | Featurable::ENABLED | false + true | ref(:guest) | Featurable::ENABLED | true + true | ref(:guest) | Featurable::PRIVATE | true + true | ref(:guest) | Featurable::DISABLED | false + true | ref(:non_member) | Featurable::ENABLED | true + true | ref(:non_member) | Featurable::PRIVATE | false + true | ref(:non_member) | Featurable::DISABLED | false + end + with_them do + before do + stub_feature_flags(ml_experiment_tracking: ff_ml_experiment_tracking) + project.project_feature.update!(model_experiments_access_level: access_level) + end + + if params[:allowed] + it { is_expected.to be_allowed(:read_model_experiments) } + else + it { is_expected.not_to be_allowed(:read_model_experiments) } + end + end + end + private def project_subject(project_type) |