blob: ff88d2a5d000d4ff700abf5d71ccef446ead83ef (
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'
describe Gitlab::BackgroundMigration::MigrateNullPrivateProfileToFalse, schema: 20190620105427 do
let(:users) { table(:users) }
it 'correctly migrates nil private_profile to false' do
private_profile_true = users.create!(private_profile: true, projects_limit: 1, email: 'a@b.com')
private_profile_false = users.create!(private_profile: false, projects_limit: 1, email: 'b@c.com')
private_profile_nil = users.create!(private_profile: nil, projects_limit: 1, email: 'c@d.com')
described_class.new.perform(private_profile_true.id, private_profile_nil.id)
private_profile_true.reload
private_profile_false.reload
private_profile_nil.reload
expect(private_profile_true.private_profile).to eq(true)
expect(private_profile_false.private_profile).to eq(false)
expect(private_profile_nil.private_profile).to eq(false)
end
end
|