summaryrefslogtreecommitdiff
path: root/spec/workers/namespaces/onboarding_pipeline_created_worker_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/workers/namespaces/onboarding_pipeline_created_worker_spec.rb')
-rw-r--r--spec/workers/namespaces/onboarding_pipeline_created_worker_spec.rb25
1 files changed, 5 insertions, 20 deletions
diff --git a/spec/workers/namespaces/onboarding_pipeline_created_worker_spec.rb b/spec/workers/namespaces/onboarding_pipeline_created_worker_spec.rb
index f1789fa8fbd..6d69ccb50bd 100644
--- a/spec/workers/namespaces/onboarding_pipeline_created_worker_spec.rb
+++ b/spec/workers/namespaces/onboarding_pipeline_created_worker_spec.rb
@@ -3,30 +3,15 @@
require 'spec_helper'
RSpec.describe Namespaces::OnboardingPipelineCreatedWorker, '#perform' do
- include AfterNextHelpers
-
let_it_be(:ci_pipeline) { create(:ci_pipeline) }
- before do
- OnboardingProgress.onboard(ci_pipeline.project.namespace)
- end
-
- it 'registers an onboarding progress action' do
- expect_next(OnboardingProgressService, ci_pipeline.project.namespace)
- .to receive(:execute).with(action: :pipeline_created).and_call_original
+ it_behaves_like 'records an onboarding progress action', :pipeline_created do
+ let(:namespace) { ci_pipeline.project.namespace }
- subject.perform(ci_pipeline.project.namespace_id)
-
- expect(OnboardingProgress.completed?(ci_pipeline.project.namespace, :pipeline_created)).to eq(true)
+ subject { described_class.new.perform(ci_pipeline.project.namespace_id) }
end
- context "when a namespace doesn't exist" do
- it 'does not register an onboarding progress action' do
- expect_next(OnboardingProgressService, ci_pipeline.project.namespace).not_to receive(:execute)
-
- subject.perform(nil)
-
- expect(OnboardingProgress.completed?(ci_pipeline.project.namespace, :pipeline_created)).to eq(false)
- end
+ it_behaves_like 'does not record an onboarding progress action' do
+ subject { described_class.new.perform(nil) }
end
end