title: Can I use capybara/rspec to match a range?
body: <p>I'm testing a Rails 3.2.6 app.</p>
  
  <p>Is it possible to make an Rspec/Capybara assertion that expresses, eg:</p>
  
  <p>'If I ask for films between 1970 and 1990, the page should contain a film between those dates:'</p>
  
  <p>For example</p>
  
  <pre><code>it "should show films in the the chosen date range" do
    page.should have_selector '.year',  # then something like text: range(1970..1990)
  end
  </code></pre>
  
  <p>And conversely, can I check that no '.year' elements contain dates that are not in that range?</p>
  
  <p>Thanks for any help.</p>