Edit # 2: Does anyone have a good method of testing the “middle” of a client-server application where we can intercept requests and responses, fake a client or server as needed, and which provides self-documentation api?
Cucumber can be a good solution in many cases, but this is not quite what I am looking for. And this middle tier should be an agnostic client / server implementation. (e.g. black box).
Our client-server model is a ruby-on-rails server with a Flex client using the RESTish interface with JSON as the data format. Thus, everything that the client sends to the server is usually a single JSON parameter. The server does this and responds with a clean JSON model.
We have standard rail testing on the server, and we are working on getting proper FlexUnit tests on the client (this is a moving target). However, my team discusses the effectiveness of the current testing model, since each change on the server seems to break part of the API. This tells me that there is a problem with the API (between team members, self-documentation in the code, etc.) and the lack of proper testing for API compliance.
So, I wondered if we needed a mock client to test the server on a pure JSON level (without all the other complexities of a rich client) and, possibly, a mock server to do the same with a rich client. This will serve two purposes: document the API and provide more thorough testing of the API itself.
The reason the debate is because the rail guy claims that testing rail integration is enough to test all server requests, and the environment-based testing environment will simply be redundant.
So, the question here, given our situation, how should we relate to API self-documentation and how should we test the API itself?
EDIT:
We have routes like / foo / 444 / bar.js, but the parameters can be almost any complex JSON string, depending on the action, for example:
json={ "foo":{ "x":1, "y":2 }, "bar":[1,2,3,4,5] }
but, apart from manually edited API documents, there is no self-documentation. The rail controller often simply deserializes and applies the changes directly to the model. It would be nice to have general tests to tell us when they changed and what was expected.