Commit fe20e668 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'fix/explore-projects-by-visibility' into 'master'

Fix visibility filter on explore projects

See merge request gitlab-org/gitlab!58293
parents 416e487f b00fd68a
...@@ -131,7 +131,7 @@ class ProjectsFinder < UnionFinder ...@@ -131,7 +131,7 @@ class ProjectsFinder < UnionFinder
public_visibility_levels = Gitlab::VisibilityLevel.levels_for_user(current_user) public_visibility_levels = Gitlab::VisibilityLevel.levels_for_user(current_user)
!public_visibility_levels.include?(params[:visibility_level]) !public_visibility_levels.include?(params[:visibility_level].to_i)
end end
def owned_projects? def owned_projects?
......
---
title: Fix visibility filter on explore projects page
merge_request: 58293
author: Jonas Wälter @wwwjon
type: fixed
...@@ -129,6 +129,12 @@ RSpec.describe ProjectsFinder do ...@@ -129,6 +129,12 @@ RSpec.describe ProjectsFinder do
it { is_expected.to eq([public_project]) } it { is_expected.to eq([public_project]) }
end end
context 'as string' do
let(:params) { { visibility_level: Gitlab::VisibilityLevel::INTERNAL.to_s } }
it { is_expected.to eq([internal_project]) }
end
end end
describe 'filter by tags' do describe 'filter by tags' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment