diff --git a/spec/factories/api_user.rb b/spec/factories/api_user.rb index b1aa770c4..01c2c70e0 100644 --- a/spec/factories/api_user.rb +++ b/spec/factories/api_user.rb @@ -8,5 +8,11 @@ FactoryGirl.define do factory :api_user_epp do roles %w(epp static_registrant) end + + factory :api_user_with_unlimited_balance do + after :build do |api_user| + api_user.registrar = create(:registrar_with_unlimited_balance) + end + end end end diff --git a/spec/factories/registrar.rb b/spec/factories/registrar.rb index dd581a1d1..f8c3af81c 100644 --- a/spec/factories/registrar.rb +++ b/spec/factories/registrar.rb @@ -9,5 +9,11 @@ FactoryGirl.define do zip 'test' email 'test@test.com' country_code 'EE' + + factory :registrar_with_unlimited_balance do + after :create do |registrar| + create(:account, registrar: registrar, balance: 1_000_000) + end + end end end diff --git a/spec/features/registrar/domains/csv_export_spec.rb b/spec/features/registrar/domains/csv_export_spec.rb index 4d64c76c4..50fb5eb9a 100644 --- a/spec/features/registrar/domains/csv_export_spec.rb +++ b/spec/features/registrar/domains/csv_export_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' RSpec.feature 'CSV Export' do background do Setting.registrar_ip_whitelist_enabled = false - sign_in_to_registrar_area(user: FactoryGirl.create(:api_user)) + sign_in_to_registrar_area(user: create(:api_user_with_unlimited_balance)) end scenario 'exports csv' do