Skip to content

Commit

Permalink
specify the "class" option for each factory in the project
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivanov-Anton committed Jul 15, 2024
1 parent a6cacc4 commit e616803
Show file tree
Hide file tree
Showing 127 changed files with 127 additions and 127 deletions.
2 changes: 1 addition & 1 deletion spec/factories/account_balance_notification_settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
# fk_rails_f185d22f87 (account_id => accounts.id)
#
FactoryBot.define do
factory :account_balance_notification_setting do
factory :account_balance_notification_setting, class: 'AccountBalanceNotificationSetting' do
end
end
2 changes: 1 addition & 1 deletion spec/factories/accounts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# accounts_timezone_id_fkey (timezone_id => timezones.id)
#
FactoryBot.define do
factory :account, class: Account do
factory :account, class: 'Account' do
sequence(:name) { |n| "account#{n}" }
association :contractor, vendor: true
balance { 0 }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/active_calls.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

FactoryBot.define do
factory :active_call, class: RealtimeData::ActiveCall do
factory :active_call, class: 'RealtimeData::ActiveCall' do
trait :filled do
duration { (rand(60) + rand).round(7) }
start_time { rand(120..179).seconds.ago.to_f }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/admin_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# index_admin_users_on_reset_password_token (reset_password_token) UNIQUE
#
FactoryBot.define do
factory :admin_user do
factory :admin_user, class: 'AdminUser' do
sequence(:username) { |n| "admin#{n}" }
sequence(:email) { |n| "admin#{n}@example.com" }
password { '111111' }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/api_access.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# api_access_customer_id_fkey (customer_id => contractors.id)

FactoryBot.define do
factory :api_access, class: System::ApiAccess do
factory :api_access, class: 'System::ApiAccess' do
sequence(:login) { |n| "api_access-#{n}" }
password { ('a'..'z').to_a.shuffle.join }
allowed_ips { ['0.0.0.0', '127.0.0.1'] }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/audit_log_items.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#

FactoryBot.define do
factory :audit_log_item, class: AuditLogItem do
factory :audit_log_item, class: 'AuditLogItem' do
item_type { 'Account' }
association :item, factory: :account
event { 'update' }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/background_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#

FactoryBot.define do
factory :background_task, class: BackgroundTask do
factory :background_task, class: 'BackgroundTask' do
priority { 0 }
attempts { 0 }
handler { "--- !ruby/object:ActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper\njob_data:\n job_class: Worker::CdrExportJob\n job_id: 71b02934-f68e-4a98-a90c-de8d274a37ed\n provider_job_id: \n queue_name: cdr_export\n priority: \n arguments:\n - 1\n executions: 0\n locale: en\n" }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/billing/contacts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# contacts_contractor_id_fkey (contractor_id => contractors.id)
#
FactoryBot.define do
factory :contact, class: Billing::Contact do
factory :contact, class: 'Billing::Contact' do
sequence(:email) { |n| "rspec_mail_#{n}@example.com" }

association :contractor, factory: :customer
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/billing/invoice_documents.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#

FactoryBot.define do
factory :invoice_document, class: Billing::InvoiceDocument do
factory :invoice_document, class: 'Billing::InvoiceDocument' do
invoice
filename { 'fine.example' }

Expand Down
2 changes: 1 addition & 1 deletion spec/factories/billing/invoice_originated_destinations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#

FactoryBot.define do
factory :invoice_originated_destination, class: Billing::InvoiceOriginatedDestination do
factory :invoice_originated_destination, class: 'Billing::InvoiceOriginatedDestination' do
invoice { FactoryBot.create(:invoice, :manual, account: FactoryBot.create(:account)) }

trait :filled do
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/billing/invoice_originated_networks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#

FactoryBot.define do
factory :invoice_originated_network, class: Billing::InvoiceOriginatedNetwork do
factory :invoice_originated_network, class: 'Billing::InvoiceOriginatedNetwork' do
invoice { FactoryBot.create(:invoice, :manual, account: FactoryBot.create(:account)) }

trait :filled do
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/billing/invoice_service_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# invoice_service_data_invoice_id_fkey (invoice_id => invoices.id)
#
FactoryBot.define do
factory :invoice_service_data, class: Billing::InvoiceServiceData do
factory :invoice_service_data, class: 'Billing::InvoiceServiceData' do
invoice { FactoryBot.create(:invoice, :manual, account: FactoryBot.create(:account)) }
transactions_count { 1 }
amount { 0.01 }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/billing/invoice_templates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# invoices_templates_name_key (name) UNIQUE
#
FactoryBot.define do
factory :invoice_template, class: Billing::InvoiceTemplate do
factory :invoice_template, class: 'Billing::InvoiceTemplate' do
sequence(:name) { |n| "invoice_template#{n}" }
filename { 'filename.odt' }
end
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/billing/invoice_terminated_destinations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#

FactoryBot.define do
factory :invoice_terminated_destination, class: Billing::InvoiceTerminatedDestination do
factory :invoice_terminated_destination, class: 'Billing::InvoiceTerminatedDestination' do
invoice { FactoryBot.create(:invoice, :manual, account: FactoryBot.create(:account)) }

trait :filled do
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/billing/invoice_terminated_networks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#

FactoryBot.define do
factory :invoice_terminated_network, class: Billing::InvoiceTerminatedNetwork do
factory :invoice_terminated_network, class: 'Billing::InvoiceTerminatedNetwork' do
invoice { FactoryBot.create(:invoice, :manual, account: FactoryBot.create(:account)) }

trait :filled do
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/billing/invoices.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
# index_billing.invoices_on_reference (reference)
#
FactoryBot.define do
factory :invoice, class: Billing::Invoice do
factory :invoice, class: 'Billing::Invoice' do
start_date { 7.days.ago.utc }
end_date { 1.day.ago.utc }
state_id { Billing::InvoiceState::NEW }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/billing/package_counters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# package_counters_account_id_fkey (account_id => accounts.id)
#
FactoryBot.define do
factory :billing_package_counter, class: Billing::PackageCounter do
factory :billing_package_counter, class: 'Billing::PackageCounter' do
account { FactoryBot.create(:account) }
service { FactoryBot.create(:service) }
prefix { '' }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/billing/service_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# service_types_name_key (name) UNIQUE
#
FactoryBot.define do
factory :service_type, class: Billing::ServiceType do
factory :service_type, class: 'Billing::ServiceType' do
sequence(:name) { |n| "Service Type #{n}" }
provisioning_class { 'Billing::Provisioning::Logging' }
variables { { 'foo' => 'bar' } }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/billing/services.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# services_type_id_fkey (type_id => service_types.id)
#
FactoryBot.define do
factory :service, class: Billing::Service do
factory :service, class: 'Billing::Service' do
sequence(:name) { |n| "Service_#{n}" }
account { FactoryBot.create(:account) }
type { FactoryBot.create(:service_type) }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/billing/transactions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# transactions_account_id_fkey (account_id => accounts.id)
#
FactoryBot.define do
factory :billing_transaction, class: Billing::Transaction do
factory :billing_transaction, class: 'Billing::Transaction' do
transient do
spent { true }
end
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/cdr/auth_logs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# auth_log_request_time_idx (request_time)
#
FactoryBot.define do
factory :auth_log, class: Cdr::AuthLog do
factory :auth_log, class: 'Cdr::AuthLog' do
request_time { 1.minute.ago }
code { 200 }
reason { 'OK' }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/cdr/cdrs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
# cdr_vendor_id_time_start_idx (vendor_id,time_start)
#
FactoryBot.define do
factory :cdr, class: Cdr::Cdr do
factory :cdr, class: 'Cdr::Cdr' do
uuid { SecureRandom.uuid }
is_last_cdr { true }
time_start { 1.minute.ago }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/cdr_exports.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# fk_rails_e796f29195 (customer_account_id => accounts.id)
#
FactoryBot.define do
factory :cdr_export, class: CdrExport do
factory :cdr_export, class: 'CdrExport' do
type { 'Base' }
callback_url { nil }
filters do
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/cnam/database_https.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# url :string not null
#
FactoryBot.define do
factory :cnam_database_http, class: Cnam::DatabaseHttp do
factory :cnam_database_http, class: 'Cnam::DatabaseHttp' do
url { 'https://example.com/{pai}' }
timeout { 15_000 }
end
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/cnam/databases.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# cnam_databases_name_key (name) UNIQUE
#
FactoryBot.define do
factory :cnam_database, class: Cnam::Database do
factory :cnam_database, class: 'Cnam::Database' do
sequence(:name) { |n| "CNAM db script_#{n}" }
request_lua { 'arg.a="000"; table.insert(arg.v,9); return arg;' }
response_lua { 'arg.a="000"; table.insert(arg.v,9); return arg;' }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/codec_group_codec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#

FactoryBot.define do
factory :codec_group_codec do
factory :codec_group_codec, class: 'CodecGroupCodec' do
sequence(:priority, 10)
dynamic_payload_type { 100 }
end
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/codec_groups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# codec_groups_name_key (name) UNIQUE
#
FactoryBot.define do
factory :codec_group do
factory :codec_group, class: 'CodecGroup' do
sequence(:name) { |n| "codec_group#{n}" }
codec_group_codecs do
[
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/contractors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# contractors_smtp_connection_id_fkey (smtp_connection_id => smtp_connections.id)
#
FactoryBot.define do
factory :contractor, class: Contractor do
factory :contractor, class: 'Contractor' do
sequence(:name) { |n| "contractor#{n}" }
enabled { true }
vendor { false }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/cron_job_infos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# name :string not null
#
FactoryBot.define do
factory :cron_job_info, class: CronJobInfo do
factory :cron_job_info, class: 'CronJobInfo' do
name { nil } # required

trait :active do
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/customers_auths.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
# customers_auth_transport_protocol_id_fkey (transport_protocol_id => transport_protocols.id)
#
FactoryBot.define do
factory :customers_auth, class: CustomersAuth do
factory :customers_auth, class: 'CustomersAuth' do
sequence(:name) { |n| "customers_auth_#{n}" }
diversion_policy_id { 1 }
dump_level_id { 1 }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/dialpeer_next_rates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# dialpeer_next_rates_dialpeer_id_fkey (dialpeer_id => dialpeers.id)
#
FactoryBot.define do
factory :dialpeer_next_rate do
factory :dialpeer_next_rate, class: 'DialpeerNextRate' do
initial_rate { 0 }
next_rate { 0 }
initial_interval { 5 }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/dialpeers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
# dialpeers_vendor_id_fkey (vendor_id => contractors.id)
#
FactoryBot.define do
factory :dialpeer, class: Dialpeer do
factory :dialpeer, class: 'Dialpeer' do
sequence(:external_id)
enabled { true }
reverse_billing { false }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/disconnect_codes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#

FactoryBot.define do
factory :disconnect_code, class: DisconnectCode do
factory :disconnect_code, class: 'DisconnectCode' do
id { (DisconnectCode.pick(Arel.sql('MAX(id)')) || 0) + 1 } # broken sequence in class4.sql
sequence(:code, 100) { |n| n }
sequence(:reason, 100) { |n| "reason_#{n}" }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/disconnect_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#

FactoryBot.define do
factory :disconnect_policy, class: DisconnectPolicy do
factory :disconnect_policy, class: 'DisconnectPolicy' do
sequence(:name) { |n| "disconnect_policy#{n}" }

trait :filled do
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/disconnect_policy_code.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#

FactoryBot.define do
factory :disconnect_policy_code, class: DisconnectPolicyCode do
factory :disconnect_policy_code, class: 'DisconnectPolicyCode' do
policy { DisconnectPolicy.take || create(:disconnect_policy) }
code { DisconnectCode.take! }
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#

FactoryBot.define do
factory :accounting_profile_start_attribute, class: Equipment::Radius::AccountingProfileStartAttribute do
factory :accounting_profile_start_attribute, class: 'Equipment::Radius::AccountingProfileStartAttribute' do
association :profile, factory: :accounting_profile
type_id { 1 }
sequence(:name) { |n| "accounting_profile_start_#{n}" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#

FactoryBot.define do
factory :accounting_profile_stop_attribute, class: Equipment::Radius::AccountingProfileStopAttribute do
factory :accounting_profile_stop_attribute, class: 'Equipment::Radius::AccountingProfileStopAttribute' do
association :profile, factory: :accounting_profile
type_id { 1 }
sequence(:name) { |n| "accounting_profile_stop_#{n}" }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/equipment/radius/accounting_profiles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# radius_accounting_profiles_name_key (name) UNIQUE
#
FactoryBot.define do
factory :accounting_profile, class: Equipment::Radius::AccountingProfile do
factory :accounting_profile, class: 'Equipment::Radius::AccountingProfile' do
sequence(:name) { |n| "profile#{n}" }
server { 'server' }
port { '1' }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/equipment/radius/auth_profiles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# radius_auth_profiles_name_key (name) UNIQUE
#
FactoryBot.define do
factory :auth_profile, class: Equipment::Radius::AuthProfile do
factory :auth_profile, class: 'Equipment::Radius::AuthProfile' do
sequence(:name) { |n| "auth_profile#{n}" }
server { 'server' }
port { '1' }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/equipment/registrations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# registrations_transport_protocol_id_fkey (transport_protocol_id => transport_protocols.id)
#
FactoryBot.define do
factory :registration, class: Equipment::Registration do
factory :registration, class: 'Equipment::Registration' do
sequence(:name) { |n| "Equipment Registration #{n}" }
domain { 'localhost' }
username { 'user name' }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/equipment/sip_options_probers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
# sip_options_probers_transport_protocol_id_fkey (transport_protocol_id => transport_protocols.id)
#
FactoryBot.define do
factory :sip_options_prober, class: Equipment::SipOptionsProber do
factory :sip_options_prober, class: 'Equipment::SipOptionsProber' do
sequence(:name) { |n| "SIP Options Prober #{n}" }
sequence(:ruri_domain) { |n| "#{n}.sip.com" }
sequence(:ruri_username) { |n| "username_#{n}" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# updated_at :timestamptz
#
FactoryBot.define do
factory :stir_shaken_signing_certificate, class: Equipment::StirShaken::SigningCertificate do
factory :stir_shaken_signing_certificate, class: 'Equipment::StirShaken::SigningCertificate' do
sequence(:name) { |n| "test_#{n}" }
sequence(:certificate) { |n| "----BEGIN CERTIFICATE----\n test_#{n}\n----END CERTIFICATE----" }
sequence(:key) { |n| "----BEGIN PRIVATE KEY----\n test_#{n}\n----END PRIVATE KEY----" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# updated_at :timestamptz
#
FactoryBot.define do
factory :stir_shaken_trusted_certificate, class: Equipment::StirShaken::TrustedCertificate do
factory :stir_shaken_trusted_certificate, class: 'Equipment::StirShaken::TrustedCertificate' do
sequence(:name) { |n| "test_#{n}" }
sequence(:certificate) { |n| "----BEGIN CERTIFICATE----\n test_#{n}\n----END CERTIFICATE----" }
updated_at { Time.now.utc.change(usec: 0) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# updated_at :timestamptz
#
FactoryBot.define do
factory :stir_shaken_trusted_repository, class: Equipment::StirShaken::TrustedRepository do
factory :stir_shaken_trusted_repository, class: 'Equipment::StirShaken::TrustedRepository' do
sequence(:url_pattern) { |n| "https://test_#{n}" }
validate_https_certificate { true }
updated_at { Time.now.utc.change(usec: 0) }
Expand Down
Loading

0 comments on commit e616803

Please sign in to comment.