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.8.2 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.8.1 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.8.0 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.7.3 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.7.2 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.7.1 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.7.0 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.6.1 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.6.0 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.5.5 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.5.4 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.5.3 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.5.2 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.5.1 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.5.0 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.4.10 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.4.9 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.2.28.1 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.4.8 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.4.7 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb