summaryrefslogtreecommitdiff
path: root/spec/models/group_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/group_spec.rb')
-rw-r--r--spec/models/group_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb
index d2a29228df3..9e4644e4054 100644
--- a/spec/models/group_spec.rb
+++ b/spec/models/group_spec.rb
@@ -41,6 +41,7 @@ RSpec.describe Group do
it { is_expected.to have_many(:contacts).class_name('CustomerRelations::Contact') }
it { is_expected.to have_many(:organizations).class_name('CustomerRelations::Organization') }
it { is_expected.to have_one(:crm_settings) }
+ it { is_expected.to have_one(:group_feature) }
describe '#members & #requesters' do
let(:requester) { create(:user) }
@@ -295,6 +296,21 @@ RSpec.describe Group do
it_behaves_like 'a BulkUsersByEmailLoad model'
+ context 'after initialized' do
+ it 'has a group_feature' do
+ expect(described_class.new.group_feature).to be_present
+ end
+ end
+
+ context 'when creating a new project' do
+ let_it_be(:group) { create(:group) }
+
+ it 'automatically creates the groups feature for the group' do
+ expect(group.group_feature).to be_an_instance_of(Groups::FeatureSetting)
+ expect(group.group_feature).to be_persisted
+ end
+ end
+
context 'traversal_ids on create' do
context 'default traversal_ids' do
let(:group) { build(:group) }