Sha256: 13f4b8aebbd358af0d6d5b64801d4200f9e9255da81d688f34815a87a532bc3f

Contents?: true

Size: 964 Bytes

Versions: 4

Compression:

Stored size: 964 Bytes

Contents

require 'test_helper'

class RemoteEpsilonConvenienceStoreGatewayTest < MiniTest::Test
  include SamplePaymentMethods

  def gateway
    @gateway ||= ActiveMerchant::Billing::EpsilonConvenienceStoreGateway.new
  end

  def test_convenience_store_purchase_successful
    VCR.use_cassette(:convenience_store_purchase_successful) do
      response = gateway.purchase(10000, valid_convenience_store, purchase_detail)

      assert_equal true, response.success?
      assert_match /\d{7}/, response.params['receipt_number']
      assert_match /\d{4}\-\d{2}\-\d{2} \d{2}:\d{2}:\d{2}/, response.params['receipt_date']
      assert_match /\d{4}\-\d{2}\-\d{2}/, response.params['convenience_store_limit_date']
    end
  end

  def test_convenience_store_purchase_fail
    VCR.use_cassette(:convenience_store_purchase_fail) do
      response = gateway.purchase(10000, invalid_convenience_store, purchase_detail)
      assert_equal false, response.success?
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
active_merchant-epsilon-0.5.4 test/remote/gateways/remote_epsilon_convenience_store_test.rb
active_merchant-epsilon-0.5.3 test/remote/gateways/remote_epsilon_convenience_store_test.rb
active_merchant-epsilon-0.5.2 test/remote/gateways/remote_epsilon_convenience_store_test.rb
active_merchant-epsilon-0.5.1 test/remote/gateways/remote_epsilon_convenience_store_test.rb