refactor payment model and its tests
This commit is contained in:
parent
25c0046290
commit
c4d934d711
4 changed files with 111 additions and 39 deletions
|
|
@ -2,10 +2,19 @@ FactoryGirl.define do
|
|||
factory :payment do
|
||||
first_name { "#{Faker::Hipster.word} abc" }
|
||||
last_name { "#{Faker::Hipster.word} xyz" }
|
||||
credit_card_number { '4242424242424242' }
|
||||
card_verification_value { '123' }
|
||||
expiration_month { '06' }
|
||||
credit_card_number '4242424242424111'
|
||||
card_verification_value '123'
|
||||
expiration_month 6
|
||||
expiration_year { Date.current.year + 2 }
|
||||
amount { '10' }
|
||||
amount 10
|
||||
end
|
||||
|
||||
trait :invalid_credit_card do
|
||||
credit_card_number '4242424242424222'
|
||||
end
|
||||
|
||||
trait :exception_credit_card do
|
||||
credit_card_number '4242424242424333'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue