diff options
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r-- | spec/models/user_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 8e94c98ab9a..8361b523a13 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1798,6 +1798,15 @@ RSpec.describe User do it { expect(user.namespaces).to contain_exactly(user.namespace, group) } it { expect(user.manageable_namespaces).to contain_exactly(user.namespace, group) } + context 'with owned groups only' do + before do + other_group = create(:group) + other_group.add_developer(user) + end + + it { expect(user.namespaces(owned_only: true)).to contain_exactly(user.namespace, group) } + end + context 'with child groups' do let!(:subgroup) { create(:group, parent: group) } |