diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-12-29 00:00:10 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-12-29 00:00:10 +0000 |
commit | c595b41881896e0987d66d9be8b307cfed97fd7d (patch) | |
tree | e74461388cf51806f050316a5045f5270b55104c /spec/models | |
parent | 7d0e63faffcbb818e686cb3d2dd1aefdbb957d4a (diff) | |
parent | 9f39953eaf5568eb75bd2ecf1bab230bbf13f330 (diff) | |
download | gitlab-ce-c595b41881896e0987d66d9be8b307cfed97fd7d.tar.gz |
Merge branch 'dz-nested-group-access' into 'master'
Inherit permissions from parent group
See merge request !8071
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/group_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb index 7d5ecfbaa64..45fe927202b 100644 --- a/spec/models/group_spec.rb +++ b/spec/models/group_spec.rb @@ -277,4 +277,15 @@ describe Group, models: true do it { is_expected.to be_valid } it { expect(subject.parent).to be_kind_of(Group) } end + + describe '#members_with_parents' do + let!(:group) { create(:group, :nested) } + let!(:master) { group.parent.add_user(create(:user), GroupMember::MASTER) } + let!(:developer) { group.add_user(create(:user), GroupMember::DEVELOPER) } + + it 'returns parents members' do + expect(group.members_with_parents).to include(developer) + expect(group.members_with_parents).to include(master) + end + end end |