diff --git a/ee/app/models/gitlab_subscription.rb b/ee/app/models/gitlab_subscription.rb index 4c16ffdfba77921a7d112c81d1ad1bbab72cd9d0..4a3c043fd0c4e3b38764b83373cc632b92bd1f00 100644 --- a/ee/app/models/gitlab_subscription.rb +++ b/ee/app/models/gitlab_subscription.rb @@ -157,9 +157,8 @@ def automatically_index_in_elasticsearch? return false unless ::Gitlab.com? return false if expired? - # We only index paid groups on dot com for now. - # If the namespace is in trial, seats will be ignored. - Plan::PAID_HOSTED_PLANS.include?(plan_name) && (trial? || seats > 0) + # We only index paid groups or trials on dot com for now. + Plan::PAID_HOSTED_PLANS.include?(plan_name) end # Kick off Elasticsearch indexing for paid groups with new or upgraded paid, hosted subscriptions diff --git a/ee/spec/models/gitlab_subscription_spec.rb b/ee/spec/models/gitlab_subscription_spec.rb index e35cf0c005a68c536648631bab654bd5c6c154f9..9ddc7b7054cec16f8fe743420e3199dae8a31bca 100644 --- a/ee/spec/models/gitlab_subscription_spec.rb +++ b/ee/spec/models/gitlab_subscription_spec.rb @@ -499,8 +499,8 @@ context 'when seats is 0' do let(:gitlab_subscription) { build(:gitlab_subscription, namespace: namespace, seats: 0) } - it 'does not index the namespace' do - expect(ElasticsearchIndexedNamespace).not_to receive(:safe_find_or_create_by!) + it 'indexes the namespace' do + expect(ElasticsearchIndexedNamespace).to receive(:safe_find_or_create_by!).with(namespace_id: gitlab_subscription.namespace_id) gitlab_subscription.save! end