Add "registrar_with_unlimited_balance" factory

#248
This commit is contained in:
Artur Beljajev 2017-01-08 21:45:47 +02:00
parent 596cb8f55d
commit a1bdfa8df4
3 changed files with 13 additions and 1 deletions

View file

@ -8,5 +8,11 @@ FactoryGirl.define do
factory :api_user_epp do factory :api_user_epp do
roles %w(epp static_registrant) roles %w(epp static_registrant)
end 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
end end

View file

@ -9,5 +9,11 @@ FactoryGirl.define do
zip 'test' zip 'test'
email 'test@test.com' email 'test@test.com'
country_code 'EE' 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
end end

View file

@ -3,7 +3,7 @@ require 'rails_helper'
RSpec.feature 'CSV Export' do RSpec.feature 'CSV Export' do
background do background do
Setting.registrar_ip_whitelist_enabled = false 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 end
scenario 'exports csv' do scenario 'exports csv' do