diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-15 12:08:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-15 12:08:57 +0300 |
commit | 45a8c43afe8a17de19a92708b380b29b6ae04ce6 (patch) | |
tree | 4104e6ac741fbbdeefe9b8b699650a06c14e9056 /spec/helpers | |
parent | 6bc327a3491069240bd73cc83e17b3078c4148b0 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/projects_helper_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb index f7cbe8c816b..3eb1090c9dc 100644 --- a/spec/helpers/projects_helper_spec.rb +++ b/spec/helpers/projects_helper_spec.rb @@ -777,6 +777,34 @@ RSpec.describe ProjectsHelper, feature_category: :source_code_management do end end + describe '#show_mobile_devops_project_promo?' do + using RSpec::Parameterized::TableSyntax + + where(:hide_cookie, :feature_flag_enabled, :mobile_target_platform, :result) do + false | true | true | true + false | false | true | false + false | false | false | false + false | true | false | false + true | false | false | false + true | true | false | false + true | true | true | false + true | false | true | false + end + + with_them do + before do + allow(Gitlab).to receive(:com?) { gitlab_com } + Feature.enable(:mobile_devops_projects_promo, feature_flag_enabled) + project.project_setting.target_platforms << 'ios' if mobile_target_platform + helper.request.cookies["hide_mobile_devops_promo_#{project.id}"] = true if hide_cookie + end + + it 'resolves if the user can import members' do + expect(helper.show_mobile_devops_project_promo?(project)).to eq result + end + end + end + describe '#can_admin_project_member?' do context 'when user is project owner' do before do |