Sha256: 4bd38464d1421c6580b10a558724c21ff16ce732e284986afd975afaa9c9f03c

Contents?: true

Size: 800 Bytes

Versions: 23

Compression:

Stored size: 800 Bytes

Contents

require 'test_helper'

class ResponseTest < Minitest::Test
  def test_initialize_success
    response = RateResponse.new(true, "success!", {:rate => 'Free!'}, :rates => [stub(:service_name => 'Free!', :total_price => 0)], :xml => "<rate>Free!</rate>")
    assert response.success?
  end

  def test_initialize_failure
    assert_raises(ActiveShipping::ResponseError) do
      RateResponse.new(false, "fail!", {:rate => 'Free!'}, :rates => [stub(:service_name => 'Free!', :total_price => 0)], :xml => "<rate>Free!</rate>")
    end
  end

  def test_initialize_failure_no_raise
    response = RateResponse.new(false, "fail!", {:rate => 'Free!'}, :rates => [stub(:service_name => 'Free!', :total_price => 0)], :xml => "<rate>Free!</rate>", :allow_failure => true)
    refute response.success?
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
active_shipping-1.14.2 test/unit/response_test.rb
active_shipping-1.14.1 test/unit/response_test.rb
active_shipping-1.14.0 test/unit/response_test.rb
active_shipping-1.13.4 test/unit/response_test.rb
active_shipping-1.13.3 test/unit/response_test.rb
active_shipping-1.13.2 test/unit/response_test.rb
active_shipping-1.13.1 test/unit/response_test.rb
active_shipping-1.13.0 test/unit/response_test.rb
active_shipping-1.12.1 test/unit/response_test.rb
active_shipping-1.12.0 test/unit/response_test.rb
active_shipping-1.11.1 test/unit/response_test.rb
active_shipping-1.11.0 test/unit/response_test.rb
active_shipping-1.10.1 test/unit/response_test.rb
active_shipping-1.9.2 test/unit/response_test.rb
active_shipping-1.9.1 test/unit/response_test.rb
active_shipping-1.9.0 test/unit/response_test.rb
active_shipping-1.8.6 test/unit/response_test.rb
active_shipping-1.8.5 test/unit/response_test.rb
active_shipping-1.8.4 test/unit/response_test.rb
active_shipping-1.8.3 test/unit/response_test.rb