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

unconfirm_wrongfully_verified_emails_spec.rb « migrations « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e93f2cb64de4200e845bc74a1c248e78f9d112f9 (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 Rails.root.join('db', 'post_migrate', '20200615111857_unconfirm_wrongfully_verified_emails.rb')

RSpec.describe UnconfirmWrongfullyVerifiedEmails do
  before do
    user = table(:users).create!(name: 'user1', email: 'test1@test.com', projects_limit: 1)
    table(:emails).create!(email: 'test2@test.com', user_id: user.id)
  end

  it 'enqueues WrongullyConfirmedEmailUnconfirmer job' do
    Sidekiq::Testing.fake! do
      migrate!

      jobs = BackgroundMigrationWorker.jobs
      expect(jobs.size).to eq(1)
      expect(jobs.first["args"].first).to eq(Gitlab::BackgroundMigration::WrongfullyConfirmedEmailUnconfirmer.name.demodulize)
    end
  end
end