Efficient Tests for modern Full-Stack Web Applications with JSON in the middle



I’m trying to come up with efficient tests design for the full stack application which combines both client (web ui) and server in one, communicating via JSON API.

I come up with a sample app which is Ruby on Rails:

And I keen to hear more from others experiences :slight_smile:



tl;dr The key difference comparing to common approaches is that we treat rails models as a resource documents and use them to assert both UI and API endpoints, without exposing serialization details (JSON Schema) into the tests. As a result it simplify tests, reduces coupling, duplication and expresses architecture.