February 2019
Intermediate to advanced
240 pages
5h 25m
English
Rails system tests[42]—added in Rails 5.1[43]—allow you to perform high-level, end-to-end tests of your application. Rather than testing that individual functions or methods perform as they should (unit testing), they test the application based on how the user interacts with it—that is, via a web interface. They allow us to assert that when a user interacts with our application in a certain way (such as filling in forms, clicking links or buttons), the app responds as we’d expect (such as displaying the correct page, having the correct things appear on the page).
Although this kind of end-to-end test was possible previously—for example, with RSpec Feature specs[44]—system tests bring a number of benefits. We no ...