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>2021-06-17 15:10:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-17 15:10:02 +0300
commit11cb5f046dddc630abd416593e176d65f6ba2b69 (patch)
tree01019213f9ea4a50fa5b7c7593e98570f6fa5c69 /spec/workers/namespaces
parent612bb6f624ea7fdf5fd20e3332d543191603db88 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/namespaces')
-rw-r--r--spec/workers/namespaces/in_product_marketing_emails_worker_spec.rb39
1 files changed, 16 insertions, 23 deletions
diff --git a/spec/workers/namespaces/in_product_marketing_emails_worker_spec.rb b/spec/workers/namespaces/in_product_marketing_emails_worker_spec.rb
index 3b94eb0d1be..2e7b6356692 100644
--- a/spec/workers/namespaces/in_product_marketing_emails_worker_spec.rb
+++ b/spec/workers/namespaces/in_product_marketing_emails_worker_spec.rb
@@ -2,38 +2,31 @@
require 'spec_helper'
-RSpec.describe Namespaces::InProductMarketingEmailsWorker, '#perform' do
- using RSpec::Parameterized::TableSyntax
-
+RSpec.describe Namespaces::InProductMarketingEmailsWorker, '#perform', unless: Gitlab.ee? do
# Running this in EE would call the overridden method, which can't be tested in CE.
# The EE code is covered in a separate EE spec.
- context 'not on gitlab.com', unless: Gitlab.ee? do
- let(:is_gitlab_com) { false }
-
- where(:in_product_marketing_emails_enabled, :experiment_active, :executes_service) do
- true | true | 1
- true | false | 1
- false | false | 0
- false | true | 0
+
+ context 'when the in_product_marketing_emails_enabled setting is disabled' do
+ before do
+ stub_application_setting(in_product_marketing_emails_enabled: false)
end
- with_them do
- it_behaves_like 'in-product marketing email'
+ it 'does not execute the email service' do
+ expect(Namespaces::InProductMarketingEmailsService).not_to receive(:send_for_all_tracks_and_intervals)
+
+ subject.perform
end
end
- context 'on gitlab.com' do
- let(:is_gitlab_com) { true }
-
- where(:in_product_marketing_emails_enabled, :experiment_active, :executes_service) do
- true | true | 1
- true | false | 0
- false | false | 0
- false | true | 0
+ context 'when the in_product_marketing_emails_enabled setting is enabled' do
+ before do
+ stub_application_setting(in_product_marketing_emails_enabled: true)
end
- with_them do
- it_behaves_like 'in-product marketing email'
+ it 'executes the email service' do
+ expect(Namespaces::InProductMarketingEmailsService).to receive(:send_for_all_tracks_and_intervals)
+
+ subject.perform
end
end
end