2017-05-22 09:55:58 +00:00
|
|
|
require 'spec_helper'
|
2017-05-22 21:33:08 +00:00
|
|
|
require Rails.root.join('db', 'post_migrate', '20170503004427_update_retried_for_ci_build.rb')
|
2017-05-22 09:55:58 +00:00
|
|
|
|
2018-01-17 11:30:25 +00:00
|
|
|
describe UpdateRetriedForCiBuild, :delete do
|
2018-03-30 15:18:44 +00:00
|
|
|
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
|
2017-05-22 09:55:58 +00:00
|
|
|
|
|
|
|
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
|