From 2530d18b0d9a67c0290fad593a38aee9dbb490ee Mon Sep 17 00:00:00 2001 From: Andrew White Date: Wed, 18 Dec 2024 17:25:12 +0000 Subject: [PATCH] Use strings for nested model factory class names Using the actual class name triggers the model to load in situations where this is undesirable such as when creating the database during CI runs. --- spec/factories/local_authority_informative.rb | 2 +- spec/factories/local_authority_policy_area.rb | 2 +- spec/factories/local_authority_policy_guidance.rb | 2 +- spec/factories/local_authority_policy_reference.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/factories/local_authority_informative.rb b/spec/factories/local_authority_informative.rb index cbd3756dbd..3836d6b269 100644 --- a/spec/factories/local_authority_informative.rb +++ b/spec/factories/local_authority_informative.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true FactoryBot.define do - factory :local_authority_informative, class: LocalAuthority::Informative do + factory :local_authority_informative, class: "LocalAuthority::Informative" do local_authority title { Faker::Lorem.sentence } text { Faker::Lorem.paragraph } diff --git a/spec/factories/local_authority_policy_area.rb b/spec/factories/local_authority_policy_area.rb index 925ea5d42d..21822e6677 100644 --- a/spec/factories/local_authority_policy_area.rb +++ b/spec/factories/local_authority_policy_area.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true FactoryBot.define do - factory :local_authority_policy_area, class: LocalAuthority::PolicyArea do + factory :local_authority_policy_area, class: "LocalAuthority::PolicyArea" do local_authority description { Faker::Lorem.unique.sentence } end diff --git a/spec/factories/local_authority_policy_guidance.rb b/spec/factories/local_authority_policy_guidance.rb index 1fcdd535e8..d934c06bf5 100644 --- a/spec/factories/local_authority_policy_guidance.rb +++ b/spec/factories/local_authority_policy_guidance.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true FactoryBot.define do - factory :local_authority_policy_guidance, class: LocalAuthority::PolicyGuidance do + factory :local_authority_policy_guidance, class: "LocalAuthority::PolicyGuidance" do local_authority description { Faker::Lorem.unique.sentence } end diff --git a/spec/factories/local_authority_policy_reference.rb b/spec/factories/local_authority_policy_reference.rb index c0707c27f3..a8f711f369 100644 --- a/spec/factories/local_authority_policy_reference.rb +++ b/spec/factories/local_authority_policy_reference.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true FactoryBot.define do - factory :local_authority_policy_reference, class: LocalAuthority::PolicyReference do + factory :local_authority_policy_reference, class: "LocalAuthority::PolicyReference" do local_authority code { Faker::IDNumber.unique.ssn_valid } description { Faker::Lorem.unique.sentence }