Chapter 11Testing Rails Display Elements

Rails applications have a specific structure, which starts with the model-view-controller (MVC) pattern. The view layer has the responsibility of presenting data to the user, which in a server-side web application usually means generating HTML. Ideally, the view layer does this with minimal interaction with the model. The controller takes in information about the user request, contacts the appropriate parts of the model layer for data, and passes that information on to the view layer. The following is a simplified diagram of this pattern.

images/mvc.png

Rails has augmented this pattern with other standard layers for ...

Get Rails 5 Test Prescriptions 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.