improve test setup with factory bot
This commit is contained in:
28
spec/factories/fiat_balances.rb
Normal file
28
spec/factories/fiat_balances.rb
Normal file
@@ -0,0 +1,28 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: fiat_balances
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# amount_cents :integer default(0), not null
|
||||
# amount_currency :string default("BRL"), not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# user_id :bigint not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_fiat_balances_on_user_id (user_id)
|
||||
#
|
||||
# Foreign Keys
|
||||
#
|
||||
# fk_rails_... (user_id => users.id)
|
||||
#
|
||||
FactoryBot.define do
|
||||
factory :fiat_balance do
|
||||
association :user
|
||||
amount_currency { "BRL" }
|
||||
amount_cents { Faker::Number.number(digits: 10) }
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user