Created
November 23, 2013 14:45
-
-
Save laserlemon/7615336 to your computer and use it in GitHub Desktop.
How to create Balanced errors with Factory Girl
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
FactoryGirl.define do | |
trait :balanced_error do | |
skip_create | |
initialize_with do | |
new(body: attributes) | |
end | |
end | |
factory :balanced_payment_required, class: Balanced::PaymentRequired do | |
balanced_error | |
additional "Account Frozen" | |
category_code "card-declined" | |
category_type "banking" | |
description { "R758: Account Frozen. Your request id is #{request_id}." } | |
extras({}) | |
request_id { "OMH#{SecureRandom.hex}" } | |
status "Payment Required" | |
status_code 402 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment