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

steal_merge_request_diff_commit_users_migration_spec.rb « migrations « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3ad0b5a93c29352e56943d395b4b3f4fe421a441 (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'
require_migration! 'steal_merge_request_diff_commit_users_migration'

RSpec.describe StealMergeRequestDiffCommitUsersMigration, :migration do
  let(:migration) { described_class.new }

  describe '#up' do
    it 'schedules a job if there are pending jobs' do
      Gitlab::Database::BackgroundMigrationJob.create!(
        class_name: 'MigrateMergeRequestDiffCommitUsers',
        arguments: [10, 20]
      )

      expect(migration)
        .to receive(:migrate_in)
        .with(1.hour, 'StealMigrateMergeRequestDiffCommitUsers', [10, 20])

      migration.up
    end

    it 'does not schedule any jobs when all jobs have been completed' do
      expect(migration).not_to receive(:migrate_in)

      migration.up
    end
  end
end