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

deactivated_deployments_delete_cron_worker_spec.rb « pages « workers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b4ee1d6b43972df7a444faca7d204ffe91d6484c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Pages::DeactivatedDeploymentsDeleteCronWorker, feature_category: :pages do
  subject(:worker) { described_class.new }

  it 'deletes all deactivated pages deployments' do
    create(:pages_deployment) # active
    create(:pages_deployment, deleted_at: 3.minutes.ago) # deactivated
    create(:pages_deployment, path_prefix: 'other', deleted_at: 3.minutes.ago) # deactivated

    expect { worker.perform }.to change { PagesDeployment.count }.by(-2)
  end
end