diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 10:34:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 10:34:06 +0000 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /spec/workers/namespaces/onboarding_pipeline_created_worker_spec.rb | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) | |
download | gitlab-ce-13.9.0-rc42.tar.gz |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'spec/workers/namespaces/onboarding_pipeline_created_worker_spec.rb')
-rw-r--r-- | spec/workers/namespaces/onboarding_pipeline_created_worker_spec.rb | 25 |
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 |