Skip to content
This repository has been archived by the owner on Feb 22, 2019. It is now read-only.

Commit

Permalink
Updating README to explain how things work
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Malan committed Jan 24, 2015
1 parent 5304d72 commit da3a62a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ insertCassette(cassette);

## Creating a recording

* in a QUnit test click on the "Record API Queries checkbox
* in a QUnit test click on the "Record API Queries" checkbox (typically you should do it on the global test route)
* when the tests are finished a file will automatically be downloaded
* replace the current cassette.js in tests/helpers with the new cassette.js


## How it works

* When record is set to true, every ajax response is monitored and saved to an array.
* Within one recording session responses are cached, so you will only hit the same endpoint once.
* At the end of the session a "cassette" is saved in the format that Sinon Fake server expects.
* If record is not true, Sinon Fake server is pre-loaded with your already recorded cassette.
* If something has not been recorded, it will be downloaded at the end of a test run. The new cassette can be manually merged.

0 comments on commit da3a62a

Please sign in to comment.