shipping_rate_test.rb 681 B

1234567891011121314151617
  1. # frozen_string_literal: true
  2. require 'test_helper'
  3. class ShippingRateTest < Test::Unit::TestCase
  4. test ":get lists all shipping rates for a given checkout" do
  5. fake 'checkouts', method: :get, status: 200, body: load_fixture('checkouts')
  6. checkouts = ShopifyAPI::Checkout.all
  7. fake "checkouts/#{checkouts.first.id}/shipping_rates",
  8. method: :get, status: 200, body: load_fixture('checkouts')
  9. shipping_rates = ShopifyAPI::ShippingRate.find(:all, params: { checkout_id: checkouts.first.id })
  10. assert_equal 2, shipping_rates.first.shipping_rates.length
  11. assert_equal 'canada_post-INT.TP.BOGUS-4.00', shipping_rates.first.shipping_rates.first.id
  12. end
  13. end