Sha256: 7629284fad420d37227e2944b5fbb1fc478dbc7c513c4ac727c08ced1b127288

Contents?: true

Size: 670 Bytes

Versions: 1

Compression:

Stored size: 670 Bytes

Contents

module Spree
  module ActiveShipping
    # Bogus carrier useful for testing.  For some reasons the plugin version of this class does not work
    # properly (it fails to return a RateResponse)
    class BogusCarrier < ::ActiveShipping::Carrier
      include RSpec::Mocks::ExampleMethods

      def name
        "BogusCarrier"
      end

      # We're stubbing the rates because actual RateEstimate are too elaborate
      def find_rates(origin, destination, packages, options = {})
        ::ActiveShipping::RateResponse.new(true, "success!", {}, :rates => [instance_double('rate', service_name: 'Bogus Calculator', price: 999)], :xml => "")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_active_shipping-1.0.0 spec/lib/spree/active_shipping/bogus_carrier.rb