{"action":"created","issue":{"url":"https://api.github.com/repos/apiaryio/dredd/issues/192","labels_url":"https://api.github.com/repos/apiaryio/dredd/issues/192/labels{/name}","comments_url":"https://api.github.com/repos/apiaryio/dredd/issues/192/comments","events_url":"https://api.github.com/repos/apiaryio/dredd/issues/192/events","html_url":"https://github.com/apiaryio/dredd/issues/192","id":78181192,"number":192,"title":"Discussion about some features","user":{"login":"LinusU","id":189580,"avatar_url":"https://avatars.githubusercontent.com/u/189580?v=3","gravatar_id":"","url":"https://api.github.com/users/LinusU","html_url":"https://github.com/LinusU","followers_url":"https://api.github.com/users/LinusU/followers","following_url":"https://api.github.com/users/LinusU/following{/other_user}","gists_url":"https://api.github.com/users/LinusU/gists{/gist_id}","starred_url":"https://api.github.com/users/LinusU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LinusU/subscriptions","organizations_url":"https://api.github.com/users/LinusU/orgs","repos_url":"https://api.github.com/users/LinusU/repos","events_url":"https://api.github.com/users/LinusU/events{/privacy}","received_events_url":"https://api.github.com/users/LinusU/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/apiaryio/dredd/labels/question","name":"question","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-19T17:32:29Z","updated_at":"2015-06-18T11:29:21Z","closed_at":null,"body":"**Ping** @netmilk\r\n\r\nI think that dredd is a really cool product, and I would like to use it for pretty much every api that I build from now on. However, there is a few things that I don't know how to best accomplish in dredd at the moment and that is what I would like to open a discussion on.\r\n\r\nI have a quick and dirty implementation of what I want in [LinusU/mocha-api-blueprint](https://github.com/LinusU/mocha-api-blueprint), don't be fooled by the `mocha` in the name, that is only a minor part.\r\n\r\nI have also created an example of how it is used at [LinusU/mocha-api-blueprint-example](https://github.com/LinusU/mocha-api-blueprint-example). This is the **beautiful specifications** and the **strict testing** that I want to accomplish.\r\n\r\nThe first thing that I would like to mention is the response body. I've added a feature where I can specify the value as `{variableName}` and have it **accept any value and store it for later.** As you can see this makes it possible to test that I can make a `POST` request and then `GET` that same resource back.\r\n\r\nThis also allows me to use **`assert.deepEqual()`** for testing the values instead of guessing a JSON-schema for the response. It will make sure that the api actually stores the correct values.\r\n\r\nThe parameters in the `uriTemplate`s will now fetch the previously stored value if applicable. Please run the tests in `mocha-api-blueprint-example` to see this in action. The api will return random `id`s every time but yet it will work beautifully.\r\n\r\nThat was the most important feature, but I have also integrated very tightly with `mocha` and I think it would be great if it was very easy to integrate into any existing test frameworks. I think that this would lower the barrier for other people to start using dredd, since it would fit right into their existing setup.\r\n\r\nI think that a nice way of doing this is to expose all the transactions that needs to be run to the user, divided by category, and then let the user run them and return the response. This also ties in with the next thing; letting the user send the requests.\r\n\r\nNow, I think that this part should be optional; but I think it's brilliant to let the user run the transaction and return the result, instead of having lots of hooks. It gives the user the most control, and it makes for cleaner code.\r\n\r\nWe could just have a default handler that does the normal thing.\r\n\r\nI realize that this is a lot of very brave changes but what I really want to have is a discussion where we can see how much of this would be feasible to have in dredd, and how much that I should keep outside.\r\n\r\nIt's really two issues, the one that allows multiple and stricter tests, and the one that allows tighter integration with existing test frameworks.\r\n\r\nHappy coding :beers: "},"comment":{"url":"https://api.github.com/repos/apiaryio/dredd/issues/comments/113120618","html_url":"https://github.com/apiaryio/dredd/issues/192#issuecomment-113120618","issue_url":"https://api.github.com/repos/apiaryio/dredd/issues/192","id":113120618,"user":{"login":"netmilk","id":79609,"avatar_url":"https://avatars.githubusercontent.com/u/79609?v=3","gravatar_id":"","url":"https://api.github.com/users/netmilk","html_url":"https://github.com/netmilk","followers_url":"https://api.github.com/users/netmilk/followers","following_url":"https://api.github.com/users/netmilk/following{/other_user}","gists_url":"https://api.github.com/users/netmilk/gists{/gist_id}","starred_url":"https://api.github.com/users/netmilk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netmilk/subscriptions","organizations_url":"https://api.github.com/users/netmilk/orgs","repos_url":"https://api.github.com/users/netmilk/repos","events_url":"https://api.github.com/users/netmilk/events{/privacy}","received_events_url":"https://api.github.com/users/netmilk/received_events","type":"User","site_admin":false},"created_at":"2015-06-18T11:29:21Z","updated_at":"2015-06-18T11:29:21Z","body":"Hey @LinusU I anything I can help you with? As I mentioned I'd love to discuss it further to make everything mentioned above more convinent. I'm happy to have a call with you anytime it fits to you regarding this. Just ping me. "}}