Sha256: 3a72cb23cde1b17abee0c94d0b591c0f362b92ee1b1b02f79db90d10299c7d57

Contents?: true

Size: 834 Bytes

Versions: 62

Compression:

Stored size: 834 Bytes

Contents

require 'test_helper'

module Workarea
  module Admin
    class TransactionViewModelTest < TestCase
      setup :set_tender
      setup :set_transaction

      def set_tender
        @tender = Workarea::Payment::Tender::CreditCard.new
      end

      def set_transaction
        @transaction = TransactionViewModel.new(
          @tender.build_transaction(action: 'authorize', amount: 4.to_m)
        )
      end

      def test_payment_type
        assert_equal('credit_card', @transaction.payment_type)

        @transaction.tender = nil
        assert_equal('missing', @transaction.payment_type)
      end

      def test_payment_title
        assert_equal('Credit Card', @transaction.payment_title)

        @transaction.tender = nil
        assert_equal('Missing Tender', @transaction.payment_title)
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-admin-3.5.27 test/view_models/workarea/admin/transaction_view_model_test.rb
workarea-admin-3.5.26 test/view_models/workarea/admin/transaction_view_model_test.rb
workarea-admin-3.4.45 test/view_models/workarea/admin/transaction_view_model_test.rb
workarea-admin-3.5.25 test/view_models/workarea/admin/transaction_view_model_test.rb
workarea-admin-3.5.23 test/view_models/workarea/admin/transaction_view_model_test.rb
workarea-admin-3.4.44 test/view_models/workarea/admin/transaction_view_model_test.rb
workarea-admin-3.5.22 test/view_models/workarea/admin/transaction_view_model_test.rb
workarea-admin-3.4.43 test/view_models/workarea/admin/transaction_view_model_test.rb
workarea-admin-3.5.21 test/view_models/workarea/admin/transaction_view_model_test.rb
workarea-admin-3.4.42 test/view_models/workarea/admin/transaction_view_model_test.rb
workarea-admin-3.5.20 test/view_models/workarea/admin/transaction_view_model_test.rb
workarea-admin-3.4.41 test/view_models/workarea/admin/transaction_view_model_test.rb
workarea-admin-3.5.19 test/view_models/workarea/admin/transaction_view_model_test.rb
workarea-admin-3.4.40 test/view_models/workarea/admin/transaction_view_model_test.rb
workarea-admin-3.5.18 test/view_models/workarea/admin/transaction_view_model_test.rb
workarea-admin-3.4.39 test/view_models/workarea/admin/transaction_view_model_test.rb
workarea-admin-3.5.17 test/view_models/workarea/admin/transaction_view_model_test.rb
workarea-admin-3.4.38 test/view_models/workarea/admin/transaction_view_model_test.rb
workarea-admin-3.5.16 test/view_models/workarea/admin/transaction_view_model_test.rb
workarea-admin-3.4.37 test/view_models/workarea/admin/transaction_view_model_test.rb