From 35ec25dcb3d57b17a3dc174503b7d20dd4c46e43 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Mon, 27 Mar 2023 20:04:00 -0600 Subject: AƱade specs de Card MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/factories/card.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 spec/factories/card.rb (limited to 'spec/factories') 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 -- cgit v1.2.3