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:
Diffstat (limited to 'spec/models/namespace_spec.rb')
-rw-r--r--spec/models/namespace_spec.rb23
1 files changed, 22 insertions, 1 deletions
diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb
index 0130618d004..a3c0a43115e 100644
--- a/spec/models/namespace_spec.rb
+++ b/spec/models/namespace_spec.rb
@@ -19,7 +19,8 @@ RSpec.describe Namespace do
it { is_expected.to have_one :aggregation_schedule }
it { is_expected.to have_one :namespace_settings }
it { is_expected.to have_many :custom_emoji }
- it { is_expected.to have_many :namespace_onboarding_actions }
+ it { is_expected.to have_one :package_setting_relation }
+ it { is_expected.to have_one :onboarding_progress }
end
describe 'validations' do
@@ -1500,4 +1501,24 @@ RSpec.describe Namespace do
end
end
end
+
+ describe '#root?' do
+ subject { namespace.root? }
+
+ context 'when is subgroup' do
+ before do
+ namespace.parent = build(:group)
+ end
+
+ it 'returns false' do
+ is_expected.to eq(false)
+ end
+ end
+
+ context 'when is root' do
+ it 'returns true' do
+ is_expected.to eq(true)
+ end
+ end
+ end
end