View Testing
Learn about the assert_select method and view testing in Rails.
We'll cover the following...
View testing involves checking the presence or absence of certain key HTML elements used in your views and the contents of these HTML elements.
The assertions made for view testing are done through assert_select
.
The tests for views reside in test/controllers/
and are written in the file for the associated controller.
The tests for the app/views/links
will be written in the test/controllers/links_controller_test.rb
file.
The assert_select
method
Before you can process with writing tests for your views, you will have to learn a new ...