Remove factory_bot_rails gem

This commit is contained in:
Artur Beljajev 2019-10-03 15:12:26 +03:00
parent 54577b530b
commit aeee87ea75
26 changed files with 0 additions and 273 deletions

View file

@ -89,7 +89,6 @@ group :development do
end
group :development, :test do
gem 'factory_bot_rails'
gem 'capybara'
gem 'rspec-rails', '~> 3.6'
gem 'selenium-webdriver'

View file

@ -176,11 +176,6 @@ GEM
equalizer (0.0.11)
erubis (2.7.0)
execjs (2.7.0)
factory_bot (4.8.2)
activesupport (>= 3.0.0)
factory_bot_rails (4.8.2)
factory_bot (~> 4.8.2)
railties (>= 3.0.0)
ffi (1.9.25)
figaro (1.1.1)
thor (~> 0.14)
@ -458,7 +453,6 @@ DEPENDENCIES
e_invoice!
epp (= 1.5.0)!
epp-xml (= 1.1.0)!
factory_bot_rails
figaro (= 1.1.1)
grape
haml

View file

@ -1,8 +0,0 @@
FactoryBot.define do
factory :account do
account_type Account::CASH
balance 1
currency 'EUR'
registrar
end
end

View file

@ -1,6 +0,0 @@
FactoryBot.define do
factory :account_activity do
sum 1.0
account
end
end

View file

@ -1,5 +0,0 @@
FactoryBot.define do
factory :admin_domain_contact, parent: :domain_contact, class: AdminDomainContact do
end
end

View file

@ -1,10 +0,0 @@
FactoryBot.define do
factory :admin_user do
username 'test'
sequence(:email) { |n| "test#{n}@test.com" }
password 'a' * AdminUser.min_password_length
password_confirmation { password }
country_code 'de'
roles ['admin']
end
end

View file

@ -1,23 +0,0 @@
FactoryBot.define do
factory :api_user do
sequence(:username) { |n| "test#{n}" }
plain_text_password 'a' * ApiUser.min_password_length
roles ['super']
registrar
factory :api_user_epp do
roles %w(epp static_registrant)
end
factory :api_user_with_unlimited_balance do
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
end

View file

@ -1,18 +0,0 @@
FactoryBot.define do
factory :price, class: Billing::Price do
price Money.from_amount(1)
valid_from Time.zone.parse('05.07.2010')
valid_to Time.zone.parse('05.07.2010')
duration '1 year'
operation_category Billing::Price.operation_categories.first
zone
factory :effective_price do
expire_time { Time.zone.now + 1.day }
end
factory :expired_price do
expire_time { Time.zone.now - 1.day }
end
end
end

View file

@ -1,39 +0,0 @@
FactoryBot.define do
factory :contact do
name 'test'
sequence(:code) { |n| "test#{n}" }
phone '+123.456789'
email 'test@test.com'
street 'test'
city 'test'
zip 12345
country_code 'EE'
ident '37605030299'
ident_type 'priv'
ident_country_code 'EE'
registrar
factory :contact_private_entity do
ident_type 'priv'
end
factory :contact_legal_entity do
ident_type 'org'
ident '12345678' # valid reg no for .ee
end
factory :contact_with_address do
street 'test'
city 'test'
zip 12345
country_code 'EE'
end
factory :contact_without_address do
street nil
city nil
zip nil
country_code nil
end
end
end

View file

@ -1,12 +0,0 @@
FactoryBot.define do
factory :zone, class: DNS::Zone do
sequence(:origin) { |n| "test#{n}" }
ttl 1
refresh 1
add_attribute :retry, 1
expire 1
minimum_ttl 1
email 'test.test'
master_nameserver 'test.test'
end
end

View file

@ -1,15 +0,0 @@
FactoryBot.define do
factory :dnskey do
alg Dnskey::ALGORITHMS.first
flags Dnskey::FLAGS.first
protocol Dnskey::PROTOCOLS.first
ds_digest_type 2
public_key 'AwEAAaOf5+lz3ftsL+0CCvfJbhUF/NVsNh8BKo61oYs5fXVbuWDiH872 '\
'LC8uKDO92TJy7Q4TF9XMAKMMlf1GMAxlRspD749SOCTN00sqfWx1OMTu '\
'a28L1PerwHq7665oDJDKqR71btcGqyLKhe2QDvCdA0mENimF1NudX1BJ '\
'DDFi6oOZ0xE/0CuveB64I3ree7nCrwLwNs56kXC4LYoX3XdkOMKiJLL/ '\
'MAhcxXa60CdZLoRtTEW3z8/oBq4hEAYMCNclpbd6y/exScwBxFTdUfFk '\
'KsdNcmvai1lyk9vna0WQrtpYpHKMXvY9LFHaJxCOLR4umfeQ42RuTd82 lqfU6ClMeXs='
domain
end
end

View file

@ -1,15 +0,0 @@
FactoryBot.define do
factory :domain do
sequence(:name) { |n| "test#{n}.com" }
period 1
period_unit 'y' # Year
valid_to Time.zone.parse('2010-07-05')
registrar
registrant
after :build do |domain|
domain.admin_domain_contacts << FactoryBot.build(:admin_domain_contact)
domain.tech_domain_contacts << FactoryBot.build(:tech_domain_contact)
end
end
end

View file

@ -1,5 +0,0 @@
FactoryBot.define do
factory :domain_contact do
contact
end
end

View file

@ -1,6 +0,0 @@
FactoryBot.define do
factory :epp_session do
sequence(:session_id) { |n| "test#{n}" }
association :user, factory: :api_user
end
end

View file

@ -1,12 +0,0 @@
FactoryBot.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

@ -1,7 +0,0 @@
FactoryBot.define do
factory :nameserver do
sequence(:hostname) { |n| "ns.test#{n}.ee" }
ipv4 '192.168.1.1'
domain
end
end

View file

@ -1,10 +0,0 @@
FactoryBot.define do
factory :registrant, parent: :contact, class: Registrant do
name 'test'
factory :registrant_private_entity, class: Registrant, parent: :contact_private_entity
factory :registrant_legal_entity, class: Registrant, parent: :contact_legal_entity
factory :registrant_with_address, class: Registrant, parent: :contact_with_address
factory :registrant_without_address, class: Registrant, parent: :contact_without_address
end
end

View file

@ -1,5 +0,0 @@
FactoryBot.define do
factory :registrant_user do
end
end

View file

@ -1,9 +0,0 @@
FactoryBot.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

@ -1,26 +0,0 @@
FactoryBot.define do
factory :registrar do
sequence(:name) { |n| "test#{n}" }
sequence(:code) { |n| "test#{n}" }
sequence(:reg_no) { |n| "test#{n}" }
email 'test@test.com'
address_street 'test'
address_city 'test'
address_country_code 'US'
accounting_customer_code 'test'
language 'en'
sequence(:reference_no) { |n| "1234#{n}" }
factory :registrar_with_unlimited_balance do
after :create do |registrar|
create(:account, registrar: registrar, balance: 1_000_000)
end
end
factory :registrar_with_zero_balance do
after :create do |registrar|
create(:account, registrar: registrar, balance: 0)
end
end
end
end

View file

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

View file

@ -1,5 +0,0 @@
FactoryBot.define do
factory :tech_domain_contact, parent: :domain_contact, class: TechDomainContact do
end
end

View file

@ -1,5 +0,0 @@
FactoryBot.define do
factory :white_ip do
ipv4 '127.0.0.1'
end
end

View file

@ -1,15 +0,0 @@
require_relative 'rails_helper'
RSpec.describe 'FactoryBot', db: true do
before :example do
allow(Contact).to receive(:address_processing?).and_return(false)
end
it 'lints factories' do
factories_to_lint = FactoryBot.factories.reject do |factory|
%i(reserved_domain).include?(factory.name) || factory.name.to_s =~ /^domain/ # Ignore the ones with domain_name validator
end
FactoryBot.lint factories_to_lint
end
end

View file

@ -1,3 +0,0 @@
RSpec.configure do |config|
config.include FactoryBot::Syntax::Methods
end

View file

@ -29,8 +29,6 @@ CompanyRegister::Client = CompanyRegisterClientStub
EInvoice.provider = EInvoice::Providers::TestProvider.new
class ActiveSupport::TestCase
include FactoryBot::Syntax::Methods
ActiveRecord::Migration.check_pending!
fixtures :all