Welcome to mirror list, hosted at ThFree Co, Russian Federation.

onboarding_issue_created_worker_spec.rb « namespaces « workers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 53116815ce7e6604c7f5bb645f617628c48d7501 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Namespaces::OnboardingIssueCreatedWorker, '#perform' do
  let_it_be(:issue) { create(:issue) }

  let(:namespace) { issue.project.namespace }

  it_behaves_like 'records an onboarding progress action', :issue_created do
    subject { described_class.new.perform(namespace.id) }
  end

  it_behaves_like 'does not record an onboarding progress action' do
    subject { described_class.new.perform(nil) }
  end

  it_behaves_like 'an idempotent worker' do
    let(:job_args) { [namespace.id] }

    it 'sets the onboarding progress action' do
      OnboardingProgress.onboard(namespace)

      subject

      expect(OnboardingProgress.completed?(namespace, :issue_created)).to eq(true)
    end
  end
end