Sha256: ca09ff9d13eccc94beeec2b073b84c3c424d1e14784c80209920e7be4117ead6

Contents?: true

Size: 1.38 KB

Versions: 21

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 => DateTime.parse(transaction["created_at"]),
                                  :subscription_id => account.subscription_token }
    subscription["transactions"] << FakeBraintree.generated_transaction
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
saucy-0.15.2 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.15.1 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.15.0 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.14.5 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.14.3 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.14.2 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.14.1 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.14.0 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.13.3 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.13.2 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.13.1 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.13.0 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.12.5 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.12.4 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.12.3 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.12.2 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.12.1 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.12.0 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.11.5 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb
saucy-0.11.3 lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb