Fix migration specs using factories
We need to stub default_git_depth and default_git_depth= because some old migrations specs try to create a record using schema before that column was introduced.
This commit is contained in:
parent
280ac894d2
commit
c0a812ecb7
3 changed files with 3 additions and 3 deletions
|
@ -5,7 +5,7 @@ describe Gitlab::BackgroundMigration::DeleteDiffFiles, :migration, :sidekiq, sch
|
|||
describe '#perform' do
|
||||
before do
|
||||
# This migration was created before we introduced ProjectCiCdSetting#default_git_depth
|
||||
allow_any_instance_of(ProjectCiCdSetting).to receive(:default_git_depth?).and_return(true)
|
||||
allow_any_instance_of(ProjectCiCdSetting).to receive(:default_git_depth=).and_return(0)
|
||||
allow_any_instance_of(ProjectCiCdSetting).to receive(:default_git_depth).and_return(nil)
|
||||
end
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@ describe Gitlab::BackgroundMigration::PopulateExternalPipelineSource, :migration
|
|||
# This migration was created before we introduced metadata configs
|
||||
stub_feature_flags(ci_build_metadata_config: false)
|
||||
# This migration was created before we introduced ProjectCiCdSetting#default_git_depth
|
||||
allow_any_instance_of(ProjectCiCdSetting).to receive(:default_git_depth?).and_return(true)
|
||||
allow_any_instance_of(ProjectCiCdSetting).to receive(:default_git_depth).and_return(nil)
|
||||
allow_any_instance_of(ProjectCiCdSetting).to receive(:default_git_depth=).and_return(0)
|
||||
end
|
||||
|
||||
let!(:internal_pipeline) { create(:ci_pipeline, source: :web) }
|
||||
|
|
|
@ -12,8 +12,8 @@ describe RemoveOrphanedLabelLinks, :migration do
|
|||
|
||||
before do
|
||||
# This migration was created before we introduced ProjectCiCdSetting#default_git_depth
|
||||
allow_any_instance_of(ProjectCiCdSetting).to receive(:default_git_depth?).and_return(true)
|
||||
allow_any_instance_of(ProjectCiCdSetting).to receive(:default_git_depth).and_return(nil)
|
||||
allow_any_instance_of(ProjectCiCdSetting).to receive(:default_git_depth=).and_return(0)
|
||||
end
|
||||
|
||||
context 'add foreign key on label_id' do
|
||||
|
|
Loading…
Reference in a new issue