Commit 1173347f authored by Dylan Griffith's avatar Dylan Griffith

Merge branch 'ali/fix-factorybot-inlineassociation' into 'master'

Fix FactoryBot/InlineAssociation for serverless & terraform

See merge request gitlab-org/gitlab!45587
parents 23a3932c 306dff08
...@@ -1286,8 +1286,5 @@ FactoryBot/InlineAssociation: ...@@ -1286,8 +1286,5 @@ FactoryBot/InlineAssociation:
- 'spec/factories/packages.rb' - 'spec/factories/packages.rb'
- 'spec/factories/packages/package_file.rb' - 'spec/factories/packages/package_file.rb'
- 'spec/factories/sent_notifications.rb' - 'spec/factories/sent_notifications.rb'
- 'spec/factories/serverless/domain.rb'
- 'spec/factories/serverless/domain_cluster.rb'
- 'spec/factories/terraform/state.rb'
- 'spec/factories/uploads.rb' - 'spec/factories/uploads.rb'
- 'spec/factories/wiki_pages.rb' - 'spec/factories/wiki_pages.rb'
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Geo::TerraformStateVersionReplicator do RSpec.describe Geo::TerraformStateVersionReplicator do
let(:model_record) { build(:terraform_state_version) } let(:model_record) { build(:terraform_state_version, terraform_state: create(:terraform_state)) }
it_behaves_like 'a blob replicator' it_behaves_like 'a blob replicator'
end end
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
FactoryBot.define do FactoryBot.define do
factory :serverless_domain, class: '::Serverless::Domain' do factory :serverless_domain, class: '::Serverless::Domain' do
function_name { 'test-function' } function_name { 'test-function' }
serverless_domain_cluster { create(:serverless_domain_cluster) } serverless_domain_cluster { association(:serverless_domain_cluster) }
environment { create(:environment) } environment { association(:environment) }
skip_create skip_create
end end
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
FactoryBot.define do FactoryBot.define do
factory :serverless_domain_cluster, class: '::Serverless::DomainCluster' do factory :serverless_domain_cluster, class: '::Serverless::DomainCluster' do
pages_domain { create(:pages_domain) } pages_domain { association(:pages_domain) }
knative { create(:clusters_applications_knative) } knative { association(:clusters_applications_knative) }
creator { create(:user) } creator { association(:user) }
certificate do certificate do
File.read(Rails.root.join('spec/fixtures/', 'ssl_certificate.pem')) File.read(Rails.root.join('spec/fixtures/', 'ssl_certificate.pem'))
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
FactoryBot.define do FactoryBot.define do
factory :terraform_state, class: 'Terraform::State' do factory :terraform_state, class: 'Terraform::State' do
project { create(:project) } project { association(:project) }
sequence(:name) { |n| "state-#{n}" } sequence(:name) { |n| "state-#{n}" }
...@@ -14,7 +14,7 @@ FactoryBot.define do ...@@ -14,7 +14,7 @@ FactoryBot.define do
trait :locked do trait :locked do
sequence(:lock_xid) { |n| "lock-#{n}" } sequence(:lock_xid) { |n| "lock-#{n}" }
locked_at { Time.current } locked_at { Time.current }
locked_by_user { create(:user) } locked_by_user { association(:user) }
end end
trait :with_version do trait :with_version do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment