-
Notifications
You must be signed in to change notification settings - Fork 468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to mark a fulfillment request as failed. #294
Conversation
@@ -1,21 +1,21 @@ | |||
require 'test_helper' | |||
|
|||
class FulFillmentTest < Test::Unit::TestCase | |||
class FulFillmentRequestTest < Test::Unit::TestCase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... oops 🙈
fulfillment_request = ShopifyAPI::FulfillmentRequest.find(255858046, :params => {:order_id => 450789469}) | ||
|
||
cancelled = ActiveSupport::JSON.decode(load_fixture('fulfillment_request')) | ||
cancelled['failure_message'] = 'cancelled' | ||
fake "orders/450789469/fulfillments/695890229/cancel", :method => :post, :body => ActiveSupport::JSON.encode(cancelled) | ||
cancelled['failure_message'] = 'failure reason' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we set and test failed_at too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API does that for you.
LGTM. |
@@ -6,6 +6,6 @@ def order_id | |||
@prefix_options[:order_id] | |||
end | |||
|
|||
def cancel; load_attributes_from_response(post(:cancel, {}, only_id)); end | |||
def mark_as_failed; load_attributes_from_response(put(:mark_as_failed, { message: failure_message } )); end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does that have to be a one liner?
72fa754
to
4971a32
Compare
Adds the ability to mark a fulfillment request as failed.
@kwestein @shilpasequeira @t6d @mikeletscher
cc @kevinhughes27