diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-03-22 00:23:58 +0100 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-03-22 00:23:58 +0100 |
commit | 503244eb9638bb141e3883d40281d7188fe8c02e (patch) | |
tree | 8d903905022ad537aa46aee7cd0b7f8f239aa23e /spec | |
parent | 31266c5be4748f57a7d56bbcc6f06d570cbf5356 (diff) | |
download | gitlab-ce-503244eb9638bb141e3883d40281d7188fe8c02e.tar.gz |
Fix specsissue_12658
Diffstat (limited to 'spec')
-rw-r--r-- | spec/finders/joined_groups_finder_spec.rb | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/spec/finders/joined_groups_finder_spec.rb b/spec/finders/joined_groups_finder_spec.rb index 66a250f9dd1..f90a8e007c8 100644 --- a/spec/finders/joined_groups_finder_spec.rb +++ b/spec/finders/joined_groups_finder_spec.rb @@ -26,33 +26,34 @@ describe JoinedGroupsFinder do context "with a user" do before do private_group.add_master(profile_owner) - private_group.add_developer(profile_visitor) internal_group.add_master(profile_owner) public_group.add_master(profile_owner) end - it 'only shows groups where both users are authorized to see' do - expect(finder.execute(profile_visitor)).to eq([public_group, internal_group, private_group]) + context "when the profile visitor is in the private group" do + before do + private_group.add_developer(profile_visitor) + end + + it 'only shows groups where both users are authorized to see' do + expect(finder.execute(profile_visitor)).to eq([public_group, internal_group, private_group]) + end end - context 'if profile visitor is in one of its projects' do + context 'if profile visitor is in one of the private group projects' do before do - public_group.add_master(profile_owner) - private_group.add_master(profile_owner) project = create(:project, :private, group: private_group, name: 'B', path: 'B') - project.team.add_developer(profile_visitor) + project.team.add_user(profile_visitor, Gitlab::Access::DEVELOPER) end it 'shows group' do - expect(finder.execute(profile_visitor)).to eq([public_group, private_group]) + expect(finder.execute(profile_visitor)).to eq([public_group, internal_group, private_group]) end end context 'external users' do before do profile_visitor.update_attributes(external: true) - public_group.add_master(profile_owner) - internal_group.add_master(profile_owner) end context 'if not a member' do |