Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
>> Views must ONLY test input and status code of the response. Mock the business logic to test the status code.
Ideally our views should be very SLIM and all the logic must go in services and helper functions
If we need to access some variables from request in the service, then better destructure it in the view and pass ONLY the variable in the service NEVER the request object.
In case of API view, call the service from the serializer after validating the input. Don't come back to the view with the validated input and then put the input again in the service.
tests/forms/..* YEP FORMS!!!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment