RSpec2 does not include an have_tag test helper. Using webrat’s have_tag or have_selector matchers instead is not possible because Webrat and Rails 3 are not compatible yet. Is there a way to write useful RSpec view tests? It is possible to use assert_select instead of have_tag, but then one could Test::Unit tests in the first place. Or is it no longer recommendable to write RSpec view tests, because integration tests with Capybara or Cucumber are better?
RSpec2 does not include an have_tag test helper. Using webrat’s have_tag or have_selector matchers
Share
Webrat caused too much trouble, it is also possible to use Capybara with RSpec. The Capybara DSL (with the functions
has_selector?,has_content?, etc.) is available for the following RSpec tests:spec/requests,spec/acceptance, orspec/integration.If you use the latest version of Capybara (~> 1.0.1) – older versions like 0.4.0 won’t support this – and add the following lines to your
spec_helper.rbfilethen you could write for example the following RSpec request test