diff options
Diffstat (limited to 'spec/models/namespace_spec.rb')
-rw-r--r-- | spec/models/namespace_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb index 0516d446945..80721e11049 100644 --- a/spec/models/namespace_spec.rb +++ b/spec/models/namespace_spec.rb @@ -34,6 +34,7 @@ RSpec.describe Namespace do it { is_expected.to have_many :member_roles } it { is_expected.to have_one :cluster_enabled_grant } it { is_expected.to have_many(:work_items) } + it { is_expected.to have_many :achievements } it do is_expected.to have_one(:ci_cd_settings).class_name('NamespaceCiCdSetting').inverse_of(:namespace).autosave(true) @@ -1895,6 +1896,30 @@ RSpec.describe Namespace do end end + describe '#bot_user_namespace?' do + subject { namespace.bot_user_namespace? } + + context 'when owner is a bot user user' do + let(:user) { create(:user, :project_bot) } + let(:namespace) { user.namespace } + + it { is_expected.to be_truthy } + end + + context 'when owner is a non-bot user' do + let(:user) { create(:user) } + let(:namespace) { user.namespace } + + it { is_expected.to be_falsy } + end + + context 'when type is a group' do + let(:namespace) { create(:group) } + + it { is_expected.to be_falsy } + end + end + describe '#aggregation_scheduled?' do let(:namespace) { create(:namespace) } |