Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-04 01:23:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-04 01:23:33 +0300
commit6c3124c854cbeef391a38b5ae8330174d78348bf (patch)
treeaf77629bc34ccc517ed24d9db35895be5d02d23d /spec/models/user_spec.rb
parent9a8ae3b4e90e56f71bb770463b943512efdcd1d1 (diff)
Add latest changes from gitlab-org/gitlab@15-0-stable-ee
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r--spec/models/user_spec.rb20
1 files changed, 16 insertions, 4 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 71171f98492..f087fab1ef3 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -3740,7 +3740,7 @@ RSpec.describe User do
end
context 'has owned groups' do
- let_it_be(:group) { create(:group) }
+ let(:group) { create(:group) }
before do
group.add_owner(user)
@@ -3749,11 +3749,23 @@ RSpec.describe User do
context 'not solo owner' do
let_it_be(:user2) { create(:user) }
- before do
- group.add_owner(user2)
+ context 'with another direct owner' do
+ before do
+ group.add_owner(user2)
+ end
+
+ it { is_expected.to be_empty }
end
- it { is_expected.to be_empty }
+ context 'with an inherited owner' do
+ let_it_be(:group) { create(:group, :nested) }
+
+ before do
+ group.parent.add_owner(user2)
+ end
+
+ it { is_expected.to be_empty }
+ end
end
context 'solo owner' do