I wonder how should I test rails api with dredd, specially the show and index actions(/post{id} and /post)
I found example project https://github.com/theodorton/dredd-test-rails but there is only one method(post) described in apib file https://github.com/theodorton/dredd-test-rails/blob/master/apiary.apib
Ad 1: Yes, you pretty much want to fill it with some data prior running Dredd (and clean it later). OR you can rely on the order of operations using the --sorted
flag while launching Dredd (so a POST called before GET will create the data).
Ad 2: Your findings are indeed correct. What Dredd uses when calling an URI with parameter in is is the example value as stated in the blueprint. For example it will use 0
in call to /folders/{id}
as defined here https://github.com/zdne/todoapi/blob/master/apiary.apib#L41
Edit:
All Dredd does at the moment is really taking your endpoints as specified in blueprint and calling them with examples values as stated in the blueprint.