diff --git a/spec/factories/api_user.rb b/spec/factories/api_user.rb index 01c2c70e0..a38fb8bf9 100644 --- a/spec/factories/api_user.rb +++ b/spec/factories/api_user.rb @@ -10,8 +10,13 @@ FactoryGirl.define do end factory :api_user_with_unlimited_balance do - after :build do |api_user| - api_user.registrar = create(:registrar_with_unlimited_balance) + transient do + registrar false + end + + after :build do |api_user, evaluator| + registrar = (evaluator.registrar || create(:registrar_with_unlimited_balance)) + api_user.registrar = registrar end end end