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

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

require 'spec_helper'

RSpec.describe CronSchedulable do
  let(:ideal_next_run_at) { schedule.send(:ideal_next_run_from, Time.zone.now) }
  let(:cron_worker_next_run_at) { schedule.send(:cron_worker_next_run_from, Time.zone.now) }

  context 'for ci_pipeline_schedule' do
    let(:schedule) { create(:ci_pipeline_schedule, :every_minute) }
    let(:schedule_1) { create(:ci_pipeline_schedule, :weekly, cron_timezone: 'UTC') }
    let(:schedule_2) { create(:ci_pipeline_schedule, :weekly, cron_timezone: 'UTC') }
    let(:new_cron) { '0 0 1 1 *' }

    it_behaves_like 'handles set_next_run_at'
  end
end