I have been writing my Rails application with Cucumber in TDD mode: Tests first, then the code. Now my application needs an API. What I like about cucumber is, that I can specify my tests in plain English, so even managers understand what’s going on.
Is there any way I can do this for my JSON-API?
You can definitely achieve this. You can write step definitions to assert/verify your json responses. Something like this
While this works, this just tests the API ( controllers/actions ) work or not, ie more like “functional” testing, not Acceptance testing. As such you are not going to test the API consumer itself.