Sha256: c641814b6ffba1f158b87a9115e505809306fa3074326775569108dca50f6428

Contents?: true

Size: 1.18 KB

Versions: 5

Compression:

Stored size: 1.18 KB

Contents

require 'test_helper'

class RemoteEpsilonGmoIdGatewayTest < MiniTest::Test
  include SamplePaymentMethods

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

  def test_gmo_id_purchase_successful
    VCR.use_cassette(:gmo_id_purchase_successful) do
      detail = valid_gmo_id_purchase_detail
      response = gateway.purchase(200, detail)
      assert_equal true, response.success?
    end
  end

  def test_gmo_id_purchase_failure
    VCR.use_cassette(:gmo_id_purchase_failure) do
      detail = invalid_gmo_id_purchase_detail
      response = gateway.purchase(200, detail)
      assert_equal false, response.success?
    end
  end

  def test_gmo_id_void_successful
    VCR.use_cassette(:gmo_id_void_successful) do
      # purchase
      detail = valid_gmo_id_purchase_detail
      response = gateway.purchase(200, detail)
      assert_equal true, response.success?
      # void
      response = gateway.void(detail[:order_number])
      assert_equal true, response.success?
    end
  end

  def test_gmo_id_void_faiure
    VCR.use_cassette(:gmo_id_void_faiure) do
      response = gateway.void('1234567890')
      assert_equal false, response.success?
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
active_merchant-epsilon-0.9.2 test/remote/gateways/remote_epsilon_gmo_id_test.rb
active_merchant-epsilon-0.9.1 test/remote/gateways/remote_epsilon_gmo_id_test.rb
active_merchant-epsilon-0.9.0 test/remote/gateways/remote_epsilon_gmo_id_test.rb
active_merchant-epsilon-0.8.1 test/remote/gateways/remote_epsilon_gmo_id_test.rb
active_merchant-epsilon-0.8.0 test/remote/gateways/remote_epsilon_gmo_id_test.rb