Sha256: fa74a1e4ca239c6d23eb61152dd50b6d0975e36b633b042c13552a037d5e9e70

Contents?: true

Size: 1.38 KB

Versions: 27

Compression:

Stored size: 1.38 KB

Contents

require 'test_helper'

module Workarea
  module Admin
    class PaymentTransactionsSystemTest < SystemTest
      include Admin::IntegrationTest

      def test_viewing_transactions
        Workarea.config.checkout_payment_action = {
          shipping: 'authorize!',
          partial_shipping: 'authorize!',
          no_shipping: 'authorize!'
        }

        order = create_placed_order(id: 'FOO')
        payment = Payment.find(order.id)
        auth = payment.credit_card.transactions.first
        capture = payment.credit_card.build_transaction(
          action: 'capture',
          amount: auth.amount,
          reference: auth
        )
        capture.complete!

        visit admin.payment_transactions_path

        click_button 'Transaction'
        assert(page.has_content?('Authorize (1)'))
        assert(page.has_content?('Capture (1)'))
        click_button 'Transaction' # closes filter dropdown

        click_button 'Auth Status'
        assert(page.has_content?('Captured (1)'))

        visit admin.payment_transactions_path
        click_link 'Authorize', match: :first

        assert(page.has_content?('Transaction'))
        assert(page.has_content?('Credit Card'))
        assert(page.has_content?("#{Money.default_currency.symbol}11.00"))
        assert(page.has_content?('Bogus Gateway: Forced success'))
        assert(page.has_content?('Capture'))
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
workarea-admin-3.5.27 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.5.26 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.5.25 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.5.23 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.5.22 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.5.21 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.5.20 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.5.19 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.5.18 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.5.17 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.5.16 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.5.15 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.5.14 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.5.13 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.5.12 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.5.11 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.5.10 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.5.9 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.5.8 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.5.7 test/system/workarea/admin/payment_transactions_system_test.rb