summaryrefslogtreecommitdiff
path: root/spec/factories
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories')
-rw-r--r--spec/factories/card.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/factories/card.rb b/spec/factories/card.rb
new file mode 100644
index 0000000..ddcafaf
--- /dev/null
+++ b/spec/factories/card.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :card, class: 'Card' do
+ number { "#{rand(1000..9999)}-#{rand(1000..9999)}-#{rand(1000..9999)}-#{rand(1000..9999)}" }
+ expiration_day { rand(1..31) }
+ expiration_month { rand(1..12) }
+ expiration_year { rand(1971..2025) }
+ security_code { rand(100..999) }
+ user_account { create(:user_account) }
+ end
+end