From 4d047b95aed493bc29e36b6958bfe362607507c6 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 31 May 2024 05:54:11 -0400 Subject: [PATCH] Use more direct attribute handling in `User` fabricator (#30495) --- spec/fabricators/user_fabricator.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/fabricators/user_fabricator.rb b/spec/fabricators/user_fabricator.rb index 9031d5cd0..0df7caea6 100644 --- a/spec/fabricators/user_fabricator.rb +++ b/spec/fabricators/user_fabricator.rb @@ -1,7 +1,12 @@ # frozen_string_literal: true Fabricator(:user) do - account { Fabricate.build(:account, user: nil) } + account do |attrs| + Fabricate.build( + :account, + attrs.fetch(:account_attributes, {}).merge(user: nil) + ) + end email { sequence(:email) { |i| "#{i}#{Faker::Internet.email}" } } password '123456789' confirmed_at { Time.zone.now }