Sha256: 438b4c31afa489b95f97008f67d0194218ed5909dfb290772d2619a8dbac3535

Contents?: true

Size: 1.34 KB

Versions: 34

Compression:

Stored size: 1.34 KB

Contents

require 'test_helper'

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

      def test_viewing_transactions
        Workarea.with_config do |config|
          config.auto_capture = false

          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
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-admin-3.4.45 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.4.44 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.4.43 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.4.42 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.4.41 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.4.40 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.4.39 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.4.38 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.4.37 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.4.36 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.4.35 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.4.34 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.4.33 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.4.32 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.4.31 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.4.30 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.4.29 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.4.28 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.4.27 test/system/workarea/admin/payment_transactions_system_test.rb
workarea-admin-3.4.26 test/system/workarea/admin/payment_transactions_system_test.rb