Sha256: 175e83d9815680eb3c73510748ad342dda702e1a37ce3db97e3ceedef8ac1090
Contents?: true
Size: 1.22 KB
Versions: 37
Compression:
Stored size: 1.22 KB
Contents
require 'test_helper' class FulFillmentRequestTest < Test::Unit::TestCase def setup super fake "orders/450789469/fulfillment_requests/695890229", method: :get, body: load_fixture('fulfillment_request') end context "#mark_as_failed" do should "be able to mark_as_failed a fulfillment request" do fulfillment_request = ShopifyAPI::FulfillmentRequest.find(695890229, params: { order_id: 450789469 }) cancelled = ActiveSupport::JSON.decode(load_fixture('fulfillment_request')) cancelled['failure_message'] = 'failure reason' cancelled['message'] = nil fake "orders/450789469/fulfillment_requests/695890229/mark_as_failed", method: :put, body: ActiveSupport::JSON.encode(cancelled) assert fulfillment_request.failure_message.blank? assert fulfillment_request.mark_as_failed assert_equal 'failure reason', fulfillment_request.failure_message end end context "#find" do should "be able to find fulfillment request" do fulfillment_request = ShopifyAPI::FulfillmentRequest.find(695890229, params: { order_id: 450789469 }) assert_equal 695890229, fulfillment_request.id assert_equal 450789469, fulfillment_request.order_id end end end
Version data entries
37 entries across 37 versions & 1 rubygems