carrier_service_test.rb 725 B

123456789101112131415161718
  1. # frozen_string_literal: true
  2. require 'test_helper'
  3. class CarrierServiceTest < Test::Unit::TestCase
  4. test 'new should create carrier service' do
  5. fake("carrier_services", method: :post, body: load_fixture('carrier_service'))
  6. carrier_service = ShopifyAPI::CarrierService.new(name: "Some Postal Service")
  7. carrier_service.save
  8. assert_equal("Some Postal Service", carrier_service.name)
  9. end
  10. test 'find should return the carrier service' do
  11. fake("carrier_services/123456", method: :get, body: load_fixture('carrier_service'))
  12. carrier_service = ShopifyAPI::CarrierService.find(123456)
  13. assert_equal(123456, carrier_service.id)
  14. assert_equal("Some Postal Service", carrier_service.name)
  15. end
  16. end