recurly/recurly-client-ruby — pull request #125 by judith (2013-12-31 21:46:11+00:00)
Title: Add association for subscription to Invoice & Adjustment

and add association for invoice to Subscription to make use
of resource links added in recurly-app API V2 response

https://github.com/recurly/recurly-app/pull/2391
https://recurly.zendesk.com/agent/#/tickets/41877

approvers: @cbarton @LeahNorris

tests:

Recurly app code needs to be as revision in PR above

- Use Recurly::Invoice.find to get an invoice with a subscription
- eg. invoice = Recurly::Invoice.find 1000
- Verify that the invoice has an associated subscription object
- eg. invoice.subscription != nil
- Verify that line_item for the invoice has an associated subscription object
- eg. invoice.line_items.first.subscription != nil
- Verify that associated subscription for the invoice has an association back to the invoice
- eg. invoice.subscription.invoice != nil

===

- Use Recurly::Invoice.find to get an invoice without a subscription
- eg. invoice = Recurly::Invoice.find 1000
- Verify that the invoice does not have subscription object
- eg. invoice.subscription = nil
- Verify that line_item for the invoice does not have subscription object
- eg. invoice.line_items.first.subscription = nil
- Use Recurly::Subscription.find to get a subscription without an invoice
- eg. subscription = Recurly::Subscription.find "24b3acd5dd1404bc8e889f4bda98219f"
- Verify that the subscription does not have an invoice
- eg. subscription.invoice = nil