test/pagarme/resources/transaction_test.rb in pagarme-2.2.1 vs test/pagarme/resources/transaction_test.rb in pagarme-2.2.2
- old
+ new
@@ -46,11 +46,11 @@
transaction.refund
assert_equal transaction.status, 'refunded'
end
- should 'be able to create transaciton with boleto' do
+ should 'be able to create transaction with boleto' do
transaction = PagarMe::Transaction.charge transaction_with_boleto_params
assert_transaction_with_bolelo_on_waiting_payment transaction
end
should 'be able to send and retrieve metadata' do
@@ -133,9 +133,26 @@
transaction.capture amount: 1000
assert_equal transaction.status, 'paid'
assert_equal transaction.amount, 2000
assert_equal transaction.paid_amount, 1000
assert_equal transaction.refunded_amount, 0
+ end
+
+ should 'be able to create a transaction with billing shipping and items' do
+ change_company(api_version: { test: '2017-08-28', live: '2017-08-28'}) do
+ transaction = PagarMe::Transaction.create transaction_with_external_id_customer_with_billing_with_shipping_with_item_with_card_params
+ found_transaction = PagarMe::Transaction.find_by_id transaction.id
+
+ assert_equal found_transaction.billing, transaction.billing
+ assert_equal found_transaction.shipping, transaction.shipping
+ assert_equal found_transaction.items, transaction.items
+
+ assert found_transaction.billing
+ assert found_transaction.shipping
+ assert found_transaction.items
+
+ assert_transaction_successfully_paid transaction
+ end
end
should 'validate transaction with invalid card_number' do
transaction = PagarMe::Transaction.new transaction_with_customer_with_invalid_card_number_params
transaction.charge