Add missing factories

This commit is contained in:
Artur Beljajev 2017-10-28 20:56:49 +03:00
parent d492fa2351
commit 0cd913daf8
9 changed files with 83 additions and 0 deletions

View file

@ -0,0 +1,11 @@
FactoryGirl.define do
factory :bank_statement do
bank_code { '767' }
iban { 'EE557700771000598731' }
queried_at { Time.zone.now }
after :build do |bank_statement|
bank_statement.bank_transactions << FactoryGirl.create_pair(:bank_transaction)
end
end
end

View file

@ -0,0 +1,8 @@
FactoryGirl.define do
factory :bank_transaction do
currency { 'EUR' }
sum { 100.0 }
description { 'Invoice no. 1' }
reference_no { 'RF2405752128' }
end
end

View file

@ -0,0 +1,7 @@
FactoryGirl.define do
factory :domain_transfer do
domain
transfer_from { FactoryGirl.create(:registrar) }
transfer_to { FactoryGirl.create(:registrar) }
end
end

18
spec/factories/invoice.rb Normal file
View file

@ -0,0 +1,18 @@
FactoryGirl.define do
factory :invoice do
buyer_name 'Registrar 1'
currency { 'EUR' }
due_date { Time.zone.now.to_date + 1.day }
invoice_type 'DEB'
seller_iban { '123' }
seller_name { 'EIS' }
seller_city { 'Tallinn' }
seller_street { 'Paldiski mnt. 123' }
vat_prc 0.2
buyer { FactoryGirl.create(:registrar) }
after :build do |invoice|
invoice.invoice_items << FactoryGirl.create_pair(:invoice_item)
end
end
end

View file

@ -0,0 +1,8 @@
FactoryGirl.define do
factory :invoice_item do
description { 'add money' }
unit 1
amount 1
price 150
end
end

View file

@ -0,0 +1,12 @@
FactoryGirl.define do
factory :keyrelay do
pa_date { Time.zone.now }
expiry_relative 'P1W'
key_data_public_key 'abc'
key_data_flags 0
key_data_protocol 3
key_data_alg 3
auth_info_pw 'abc'
domain
end
end

View file

@ -0,0 +1,5 @@
FactoryGirl.define do
factory :message do
body 'fabricator body'
end
end

View file

@ -0,0 +1,9 @@
FactoryGirl.define do
factory :registrant_verification do
sequence(:domain_name) { |i| "domain#{i}.ee" }
domain
verification_token '123'
action 'confirmed'
action_type 'registrant_change'
end
end

View file

@ -0,0 +1,5 @@
FactoryGirl.define do
factory :reserved_domain do
sequence(:name) { |i| "domain#{i}.ee" }
end
end