require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")

describe Braintree::Test::TransactionAmounts do
  describe "Authorize" do
    it "creates a transaction with status authorized" do
      transaction = Braintree::Transaction.sale!(
        :amount => Braintree::Test::TransactionAmounts::Authorize,
        :credit_card => {
          :number => Braintree::Test::CreditCardNumbers::Visa,
          :expiration_date => "12/2012"
        },
      )
      expect(transaction.status).to eq(Braintree::Transaction::Status::Authorized)
    end
  end

  describe "Decline" do
    it "creates a transaction with status processor_declined" do
      result = Braintree::Transaction.sale(
        :amount => Braintree::Test::TransactionAmounts::Decline,
        :credit_card => {
          :number => Braintree::Test::CreditCardNumbers::Visa,
          :expiration_date => "12/2012"
        },
      )
      expect(result.transaction.status).to eq(Braintree::Transaction::Status::ProcessorDeclined)
    end
  end
end
