title: Capybara expect page.selector to_have
body: <p>I need to validate the presence of some text in a specific part of the page.</p>
  
  <p><code>expect(page).to</code> will output too much text, it is especially annoying for the page which hold the terms of agreement, which are always so long.</p>
  
  <p>I'd like to transform <code>expect(page).to(have_text(</code> into something like <code>expect('#id').to(have_text(...)</code></p>
  
  <p>I cannot figure out how to select the part of the page referenced by ID. Should I write my <code>expect(page)</code> inside a <code>within('#id')</code> ?</p>
  
  <p>EDIT : if possible, a solution that works against nested tags</p>
  
  <pre><code>&lt;div id="id"&gt;
    &lt;span class="nested"&gt;...&lt;/span&gt;
    Text I want to check with have_text()
  &lt;/div&gt;`
  </code></pre>