The modern Ruby QuickBooks client: Part 3 - Gem Contributing
Record your own QBO sandbox transactions in a PR
You would like to enhance or fix something in the qbo_api gem but aren't too sure about the "VCR-recorded-sandbox-transaction" part of the specs. Don't you worry a bit about that. Frankly, this "VCR-recorded-sandbox-transaction" thing will actually make it easier for you to contribute and not the other way around. Creating fictional API fixtures is the harder and more error-prone approach.
- Fork the
qbo_apigem - Clone your fork, switch into the new directory, and
bundle - Make a new branch for your PR e.g.
git checkout -b cust-ref-name - Create a
.envfile and fill in all the values - Please see part 1, which will fully explain how to get all the values you need to properly fill in the
.envfile. - Next, run the specs
bundle exec rspec spec/. - Open the spec
spec/create_update_delete_spec.rb - Add a name attribute to the
CustomerRef - Change the record setting to "all".
record: :alland rerun - Run the
git statusto see which files have been modified. - Change the
record: :allback torecord: :none. - Commit the changes:
git commit -a -m "Add CustomerRef:name information when create a new invoice" - Then push the branch and submit the pull request.
$ git clone git://github.com/[your fork]/qbo_api && cd qbo_api $ bundle
This section is at the 2:22 mark.
record: :all setting enabled the spec will test against your sandbox with VCR recording the transaction.
spec/vcr/qbo_api/create/invoice.yml has been updated with the new recording.Conclusion
Contributing to the qbo_api gem is a cinch. The fact that the gem
utilizes VCR-recorded transactions against real QuickBooks sandboxes makes it
a great choice. That said, don't be intimated at all by VCR; follow this
tutorial and you will easily be able to contribute in making the gem even better.
- Pushed on 03/01/2016 by Christian
- QuickBooks Integration Consulting
