2

I just updated a rails app to rails 3.2.11 which broke my (very basic) acceptance tests. A test which used to verify the contents of the title tag using

page.html.must_have_content(title_text)

It turned out that the page still has the title, but the page object does not provide it anymore. The following passes now:

visit Refinery::railtie_routes_url_helpers.root_path
title_text = "Tischtennisverband des Kantons Zürich"
page.html.must_have_content(title_text)
page.wont_have_content(title_text)
within "title" do
  page.wont_have_content(title_text)
end

so the html still contains my title_text, it still has a title tag (otherwise within would fail), but there is no contents to that tag anymore. Am I missing on a better way to test the content of head (as page only seems to contain body now) or do minitest-4.4.0, capybara-2.0.2 and nokogiri-1.5.6 (which got picked up during bundle update) not play along real nicely?

Patru
  • 4,481
  • 2
  • 32
  • 42
  • Not sure about mini-test, but with RSpec, I created a custom matcher that will hopefully be of reference to you at [this StackOverflow answer](http://stackoverflow.com/a/13755730/567863). – Paul Fioravanti Jan 10 '13 at 15:30
  • 1
    Capybara 2.0 [doesn't find invisible texts](https://github.com/jnicklas/capybara/issues/844) – Andrei Botalov Jan 10 '13 at 18:41
  • Possible duplicate of [How can I test the page title with Capybara 2.0?](https://stackoverflow.com/questions/13573525/how-can-i-test-the-page-title-with-capybara-2-0) – Jon Schneider Apr 12 '19 at 15:41

0 Answers0