diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-24 01:43:31 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-24 01:43:31 +0000 |
commit | e20a1cde5d740fbc9f4d033786a8cd5ad7eb8b4d (patch) | |
tree | cf76b0527f1909eaf1ecac057a4ccc7591cce4f6 /spec/helpers | |
parent | 5fc725def41e6973e92bc32095774edd60fd154f (diff) | |
download | gitlab-ce-e20a1cde5d740fbc9f4d033786a8cd5ad7eb8b4d.tar.gz |
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/explore_helper_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/helpers/explore_helper_spec.rb b/spec/helpers/explore_helper_spec.rb index 5208d3bd656..f8240dd3a4c 100644 --- a/spec/helpers/explore_helper_spec.rb +++ b/spec/helpers/explore_helper_spec.rb @@ -17,4 +17,25 @@ describe ExploreHelper do expect(helper.explore_nav_links).to contain_exactly(*menu_items) end end + + describe '#public_visibility_restricted?' do + using RSpec::Parameterized::TableSyntax + + where(:visibility_levels, :expected_status) do + nil | nil + [Gitlab::VisibilityLevel::PRIVATE] | false + [Gitlab::VisibilityLevel::PRIVATE, Gitlab::VisibilityLevel::INTERNAL] | false + [Gitlab::VisibilityLevel::PUBLIC] | true + end + + with_them do + before do + stub_application_setting(restricted_visibility_levels: visibility_levels) + end + + it 'returns the expected status' do + expect(helper.public_visibility_restricted?).to eq(expected_status) + end + end + end end |