Skip to content

Commit

Permalink
Use generated API responses in stripe-ruby tests
Browse files Browse the repository at this point in the history
This patch introduces a narrow working slice of tests that use data
generated from within the API itself to produce sample responses from a
stubbed out API in the test suite. This has a few advantages over the
current situation:

* More accurate test data back from the stub. The current `TestData`
  system is extremely prone to eroding (this is the biggest advantage).
* Basic validation gets run on incoming request parameters.
* Stubbing is run at a lower level (the HTTP library instead of the
  `Stripe` module) so we get a little more certainty that things work as
  expected.
* Contributing new tests (especially for new resources) becomes very
  easy because no sections of `TestData` are required.

Replacing the entire suite will take a few hours and involving a lot of
copy and pasting, but is entirably doable and after we're done we can
remove the entire `TestData` module and the monkey patching on the
`Stripe` module.
  • Loading branch information
brandur-stripe committed Nov 6, 2015
1 parent 59e7752 commit 22bfca0
Show file tree
Hide file tree
Showing 5 changed files with 10,171 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
schema/schema-*.yaml binary
Loading

0 comments on commit 22bfca0

Please sign in to comment.