Iteration H2: Integration Testing of Applications
Rails organizes tests into model, controller, and integration tests. Before explaining integration tests, let’s briefly recap what we’ve covered so far.
- Unit testing of models
-
Model classes contain business logic. For example, when we add a product to a cart, the cart model class checks to see if that product is already in the cart’s list of items. If so, it increments the quantity of that item; if not, it adds a new item for that product.
- Functional testing of controllers
-
Controllers direct the show. They receive incoming web requests (typically, user input), interact with models to gather application state, and then respond by causing the appropriate view to display something to the user. ...
Get Agile Web Development with Rails 5, 1st Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.