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

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

require 'spec_helper'

RSpec.describe Gitlab::BackgroundMigration::BackfillNamespaceSettings, schema: 20200703125016 do
  let(:namespaces) { table(:namespaces) }
  let(:namespace_settings) { table(:namespace_settings) }
  let(:namespace) { table(:namespaces).create!(name: 'user', path: 'user') }

  subject { described_class.new }

  describe '#perform' do
    it 'creates settings for all projects in range' do
      namespaces.create!(id: 5, name: 'test1', path: 'test1')
      namespaces.create!(id: 7, name: 'test2', path: 'test2')
      namespaces.create!(id: 8, name: 'test3', path: 'test3')

      subject.perform(5, 7)

      expect(namespace_settings.all.pluck(:namespace_id)).to contain_exactly(5, 7)
    end
  end
end