Created
April 8, 2021 10:48
-
-
Save rossta/fdb40f2d6c781b569d2bcc53e672d1cb to your computer and use it in GitHub Desktop.
FactoryBot factory for a Hash class (i.e., not an ActiveRecord model)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FactoryBot.define :stripe_customer, class: Hash do | |
skip_create | |
initialize_with { new(attributes) } | |
id { "cus_#{SecureRandom.hex(7)}" } | |
object { "customer" } | |
address { nil } | |
balance { 0 } | |
created { 1.day.ago.to_i } | |
currency { "usd" } | |
email { |n| "customer-#{n}@example.com" } | |
name { Faker::Name.name } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment