fulfillment_service_test.rb 761 B

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