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

update_retried_for_ci_build_spec.rb « migrations « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 637dcbb8e01900406fe06905e90394886444c404 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20170503004427_update_retried_for_ci_build.rb')

describe UpdateRetriedForCiBuild, :delete do
  let(:pipeline) { create(:ci_pipeline) } # rubocop:disable RSpec/FactoriesInMigrationSpecs
  let!(:build_old) { create(:ci_build, pipeline: pipeline, name: 'test') } # rubocop:disable RSpec/FactoriesInMigrationSpecs
  let!(:build_new) { create(:ci_build, pipeline: pipeline, name: 'test') } # rubocop:disable RSpec/FactoriesInMigrationSpecs

  before do
    described_class.new.up
  end

  it 'updates ci_builds.is_retried' do
    expect(build_old.reload).to be_retried
    expect(build_new.reload).not_to be_retried
  end
end