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

20211101222614_consume_remaining_user_namespace_jobs_spec.rb « migrations « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d78ecc26ebff5397570dc75b1c135fb1af970d0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

require 'spec_helper'
require_migration!

RSpec.describe ConsumeRemainingUserNamespaceJobs do
  let(:namespaces) { table(:namespaces) }
  let!(:namespace) { namespaces.create!(name: 'gitlab', path: 'gitlab-org', type: nil) }

  context 'when Namespaces with nil `type` still exist' do
    it 'steals sidekiq jobs from BackfillUserNamespace background migration' do
      expect(Gitlab::BackgroundMigration).to receive(:steal).with('BackfillUserNamespace')

      migrate!
    end

    it 'migrates namespaces without type' do
      expect { migrate! }.to change { namespaces.where(type: 'User').count }.from(0).to(1)
    end
  end
end