Sha256: 0a842cc2c7a4ea4b33126e189061ba62cce8bd636a1df580862e8b0e90570cac

Contents?: true

Size: 959 Bytes

Versions: 11

Compression:

Stored size: 959 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper'

class ResponseTest < Test::Unit::TestCase
  def test_response_success
    assert Response.new(true, 'message', :param => 'value').success?
    assert !Response.new(false, 'message', :param => 'value').success?
  end
  
  def test_get_params
    response = Response.new(true, 'message', :param => 'value')
    
    assert_equal ['param'], response.params.keys
  end
  
  def test_avs_result
    response = Response.new(true, 'message', {}, :avs_result => { :code => 'A', :street_match => 'Y', :zip_match => 'N' })
    avs_result = response.avs_result
    assert_equal 'A', avs_result['code']
    assert_equal AVSResult.messages['A'], avs_result['message']
  end
  
  def test_cvv_result
    response = Response.new(true, 'message', {}, :cvv_result => 'M')
    cvv_result = response.cvv_result
    assert_equal 'M', cvv_result['code']
    assert_equal CVVResult.messages['M'], cvv_result['message']
  end
end

Version data entries

11 entries across 11 versions & 5 rubygems

Version Path
martinstannard-activemerchant-0.1.0 test/unit/response_test.rb
seamusabshere-active_merchant-1.4.2.1 test/unit/response_test.rb
seamusabshere-active_merchant-1.4.2.3 test/unit/response_test.rb
activemerchant-1.4.0 test/unit/response_test.rb
activemerchant-1.3.0 test/unit/response_test.rb
activemerchant-1.3.1 test/unit/response_test.rb
activemerchant-1.3.2 test/unit/response_test.rb
activemerchant-1.4.1 test/unit/response_test.rb
activemerchant-1.4.2 test/unit/response_test.rb
merb_merchant-1.4.1 test/unit/response_test.rb
spree-0.2.0 vendor/plugins/active_merchant/test/unit/response_test.rb