![]() I generally don't unit test the controller or the view layer, and just let my end-to-end acceptance tests ensure that everything is plugged together correctly. I will have them talk to an adapter within my domain, which is all well encapsulated and heavily unit tested. However if I'm dealing with a complex domain then I tend to separate out my domain layer from Rails, and treat my controllers as ports (from Alistair Cockburn's ports and adapters architecture) into and out of the web. The logic in Rails is simple enough that a computer could write it, so I don't really feel a high degree of risk there. ![]() My general response is two fold.įirst, if I'm just doing CRUD reading and writing, I don't really feel the need to have unit tests for the project, so long as I have end-to-end acceptance tests. CommentsĪ good number of people have asked me that question since I wrote the post. Super extra bonus points if you post links to open source projects that have a test suite that actually do these things well.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |