Sha256: 5dd87a016ec6ea609478f1b8ac4907ea42beeacea33ce544596328c39108901c

Contents?: true

Size: 1.38 KB

Versions: 92

Compression:

Stored size: 1.38 KB

Contents

Given /^that the credit card "([^"]*)" is invalid$/ do |number|
  FakeBraintree.failures[number] = { "message" => "Credit card number is invalid.", "errors" => { "customer" => { "errors" => [], "credit-card" => { "errors" => [{ "message" => "Credit card number is invalid.", "code" => 81715, "attribute" => :number }] }}}}
end

Given /^that the credit card "([^"]*)" should not be honored$/ do |number|
  FakeBraintree.failures[number] = { "message" => "Do Not Honor", "code" => "2000", "status" => "processor_declined" }
end

Given /^the "([^"]*)" account is past due$/ do |account_name|
  account = Account.find_by_name!(account_name)
  account.update_attribute(:subscription_status, Braintree::Subscription::Status::PastDue)
end

Given /^the following transaction exist for the "([^"]*)" account:$/ do |account_name, table|
  account = Account.find_by_name!(account_name)
  subscription = FakeBraintree.subscriptions[account.subscription_token]
  subscription["transactions"] = []
  table.hashes.each do |transaction|
    FakeBraintree.transaction = { :status => transaction["status"],
                                  :amount => transaction["amount"],
                                  :created_at => Time.parse(transaction["created_at"]),
                                  :subscription_id => account.subscription_token }
    subscription["transactions"] << FakeBraintree.generated_transaction
  end
end

Version data entries

92 entries across 92 versions & 2 rubygems

Version Path
saucy-0.2.38 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.36 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.35 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.34 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.33 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.32 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.31 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.30 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.29 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.28 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.27 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.26 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.25 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.24 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.21 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.20 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.18 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.17 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.16 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.15 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb