How would I best go about testing the completeness of a page’s structural completeness?
As an example, I would like to make sure that the site menu has all required elements. It is built with a regular CSS-formatted and has elements as these:
<li><%= link_to "Some page", some_path %></li>
...
<li><%= link_to "Login", path_to_login_action %></li>
<li><%= link_to "Register", path_to_registration_action %></li>
Or is this in some way pointless anyway? (still trying to develop a sound understanding for testing style)
You could use the assert_select method:
in another case, include webrat or capybara in your Gemfile:
and use the have_selector method:
Read more about Rspec-rails: http://github.com/rspec/rspec-rails#readme (see “Request Specs” chapter)