diff options
author | James Lopez <james@jameslopez.es> | 2018-12-21 15:26:33 +0100 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2019-01-31 16:51:16 +0100 |
commit | a3cde02651af6e18fd91416ac1378aaed36ed115 (patch) | |
tree | cf9412f35f95d078cfba83f7ced326852af8da0f /spec/finders | |
parent | 57f082d969eae04112172495bb099e634069856c (diff) | |
download | gitlab-ce-a3cde02651af6e18fd91416ac1378aaed36ed115.tar.gz |
Fix contributed projects finder shown private info
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/contributed_projects_finder_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/finders/contributed_projects_finder_spec.rb b/spec/finders/contributed_projects_finder_spec.rb index 81fb4e3561c..ee84fd067d4 100644 --- a/spec/finders/contributed_projects_finder_spec.rb +++ b/spec/finders/contributed_projects_finder_spec.rb @@ -31,4 +31,16 @@ describe ContributedProjectsFinder do it { is_expected.to match_array([private_project, internal_project, public_project]) } end + + context 'user with private profile' do + it 'does not return contributed projects' do + private_user = create(:user, private_profile: true) + public_project.add_maintainer(private_user) + create(:push_event, project: public_project, author: private_user) + + projects = described_class.new(private_user).execute(current_user) + + expect(projects).to be_empty + end + end end |