How to combine find and within using Capybara?

The following works as expected: within('h2', text: 'foo') do should have_content 'bar' end I am trying to check within the parent element, using find(:xpath, '..') Once you find an elem...