Sha256: c07347238695b391af63c10059245c367bf68a10c3bc3bd8808920a8590c37ea

Contents?: true

Size: 1.25 KB

Versions: 1

Compression:

Stored size: 1.25 KB

Contents

module Workarea
  decorate Admin::PaymentTransactionsSystemTest, with: :payware_connect do
    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'), "expected page to have content 'Transaction'")
        assert(page.has_content?('Credit Card'), "expected page to have content 'Credit Card'")
        assert(page.has_content?("#{Money.default_currency.symbol}11.00"))
        assert(page.has_content?('Capture'))
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
workarea-payware_connect-2.1.2 test/system/workarea/admin/payment_transactions_system_test.decorator