Forum: RSpec RSpec/rails & Capybara: #within

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
A6e7259949f2ad953e11e152ba0de498?d=identicon&s=25 Salvatore P. (iazel)
on 2012-07-22 23:08
I'm new to Capybara and after a good amount of google, I still can't
figure out how the #within methods works!
I can use it only if I call visit before? There's no way to use it on a
string, like the `page = Capybara.string(html_string)` trick?

When describe a view, I want something like that:
describe "path/to/view.html.erb" do
  it "should pass" do
    within('form#id') {
      should have_selector 'input', type: 'submit'
      should have_selector 'input', type: 'text', value: 'default'
      # ...

PS: Hope this is the right sections! ^^"
This topic is locked and can not be replied to.