How do you test for something in a certain area of the page with RSpec / Capybara? (view test)

8 views
Skip to first unread message

David Zhang

unread,
Jun 29, 2011, 8:54:03 PM6/29/11
to rubyonra...@googlegroups.com
I'm used to doing 

it "displays the controls link" do
  render
  rendered.should have_selector("a#controls")
end

..or using rendered.should have_content, but how would you test for something specifically in an area of the page?  e.g.
rendered.should have_content("Admin") in the "div#logo_area" or something?

I kind of wish there were many clear examples online...
Reply all
Reply to author
Forward
0 new messages