diff options
author | Nick Thomas <nick@gitlab.com> | 2019-06-06 16:57:50 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-06-06 16:57:50 +0300 |
commit | 10dcfac1f17cffbbc542d47bdf27b682ab453dd2 (patch) | |
tree | 046df7d2929558adae980f2c362253bf499d0f46 /spec/migrations | |
parent | 64c6987dfdcd5cb78b4a192a4632b227eabe801f (diff) |
Revert "Merge branch 'pages-domain_ssl-valid-period' into 'master'"
This reverts merge request !28743
Diffstat (limited to 'spec/migrations')
-rw-r--r-- | spec/migrations/enqueue_verify_pages_domain_workers_spec.rb | 6 | ||||
-rw-r--r-- | spec/migrations/schedule_fill_valid_time_for_pages_domain_certificates_spec.rb | 46 |
2 files changed, 1 insertions, 51 deletions
diff --git a/spec/migrations/enqueue_verify_pages_domain_workers_spec.rb b/spec/migrations/enqueue_verify_pages_domain_workers_spec.rb index abf39317188..afcaefa0591 100644 --- a/spec/migrations/enqueue_verify_pages_domain_workers_spec.rb +++ b/spec/migrations/enqueue_verify_pages_domain_workers_spec.rb @@ -8,13 +8,9 @@ describe EnqueueVerifyPagesDomainWorkers, :sidekiq, :migration do end end - let(:domains_table) { table(:pages_domains) } - describe '#up' do it 'enqueues a verification worker for every domain' do - domains = Array.new(3) do |i| - domains_table.create!(domain: "my#{i}.domain.com", verification_code: "123#{i}") - end + domains = 1.upto(3).map { |i| PagesDomain.create!(domain: "my#{i}.domain.com") } expect { migrate! }.to change(PagesDomainVerificationWorker.jobs, :size).by(3) diff --git a/spec/migrations/schedule_fill_valid_time_for_pages_domain_certificates_spec.rb b/spec/migrations/schedule_fill_valid_time_for_pages_domain_certificates_spec.rb deleted file mode 100644 index 54f3e264df0..00000000000 --- a/spec/migrations/schedule_fill_valid_time_for_pages_domain_certificates_spec.rb +++ /dev/null @@ -1,46 +0,0 @@ -require 'spec_helper' -require Rails.root.join('db', 'post_migrate', '20190524073827_schedule_fill_valid_time_for_pages_domain_certificates.rb') - -describe ScheduleFillValidTimeForPagesDomainCertificates, :migration, :sidekiq do - let(:migration_class) { described_class::MIGRATION } - let(:migration_name) { migration_class.to_s.demodulize } - - let(:domains_table) { table(:pages_domains) } - - let(:certificate) do - File.read('spec/fixtures/passphrase_x509_certificate.crt') - end - - before do - domains_table.create!(domain: "domain1.example.com", verification_code: "123") - domains_table.create!(domain: "domain2.example.com", verification_code: "123", certificate: '') - domains_table.create!(domain: "domain3.example.com", verification_code: "123", certificate: certificate) - domains_table.create!(domain: "domain4.example.com", verification_code: "123", certificate: certificate) - end - - it 'correctly schedules background migrations' do - Sidekiq::Testing.fake! do - Timecop.freeze do - migrate! - - first_id = domains_table.find_by_domain("domain3.example.com").id - last_id = domains_table.find_by_domain("domain4.example.com").id - - expect(migration_name).to be_scheduled_delayed_migration(5.minutes, first_id, last_id) - expect(BackgroundMigrationWorker.jobs.size).to eq(1) - end - end - end - - it 'sets certificate valid_not_before/not_after' do - perform_enqueued_jobs do - migrate! - - domain = domains_table.find_by_domain("domain3.example.com") - expect(domain.certificate_valid_not_before) - .to eq(Time.parse("2018-03-23 14:02:08 UTC")) - expect(domain.certificate_valid_not_after) - .to eq(Time.parse("2019-03-23 14:02:08 UTC")) - end - end -end |