Skip to content
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

Merged
merged 1 commit into from
Aug 8, 2016

Conversation

garethson
Copy link
Contributor

Adds the ability to mark a fulfillment request as failed.

@kwestein @shilpasequeira @t6d @mikeletscher

cc @kevinhughes27

@@ -1,21 +1,21 @@
require 'test_helper'

class FulFillmentTest < Test::Unit::TestCase
class FulFillmentRequestTest < Test::Unit::TestCase
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

Copy link
Contributor

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'
Copy link
Contributor

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?

Copy link
Contributor Author

@garethson garethson Aug 8, 2016

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.

@kwestein
Copy link
Contributor

kwestein commented Aug 2, 2016

LGTM.
Travis build failed, but looks unrelated?

@@ -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
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants