Commit 306dff08 authored by Alishan Ladhani's avatar Alishan Ladhani

Fix FactoryBot/InlineAssociation for serverless & terraform

parent 99035e62
......@@ -1337,8 +1337,5 @@ FactoryBot/InlineAssociation:
- 'spec/factories/resource_milestone_event.rb'
- 'spec/factories/resource_state_event.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/wiki_pages.rb'
......@@ -3,7 +3,7 @@
require 'spec_helper'
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'
end
......@@ -3,8 +3,8 @@
FactoryBot.define do
factory :serverless_domain, class: '::Serverless::Domain' do
function_name { 'test-function' }
serverless_domain_cluster { create(:serverless_domain_cluster) }
environment { create(:environment) }
serverless_domain_cluster { association(:serverless_domain_cluster) }
environment { association(:environment) }
skip_create
end
......
......@@ -2,9 +2,9 @@
FactoryBot.define do
factory :serverless_domain_cluster, class: '::Serverless::DomainCluster' do
pages_domain { create(:pages_domain) }
knative { create(:clusters_applications_knative) }
creator { create(:user) }
pages_domain { association(:pages_domain) }
knative { association(:clusters_applications_knative) }
creator { association(:user) }
certificate do
File.read(Rails.root.join('spec/fixtures/', 'ssl_certificate.pem'))
......
......@@ -2,7 +2,7 @@
FactoryBot.define do
factory :terraform_state, class: 'Terraform::State' do
project { create(:project) }
project { association(:project) }
sequence(:name) { |n| "state-#{n}" }
......@@ -14,7 +14,7 @@ FactoryBot.define do
trait :locked do
sequence(:lock_xid) { |n| "lock-#{n}" }
locked_at { Time.current }
locked_by_user { create(:user) }
locked_by_user { association(:user) }
end
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