jnicklas/capybara — pull request #915 by abotalov (2012-12-23 18:30:03+00:00)
Title: Add count, maximum, etc. options to has_text?

This pull request aims to solve https://github.com/jnicklas/capybara/issues/642

In contrast to other selectors (such as ```has_css?```), proposed code doesn't give good looking error message like [here](https://github.com/jnicklas/capybara/blob/master/lib/capybara/result.rb#L34). Also I added a broken test (```"fails if matched text count does not equal expected count"```)

Please advice how should I write has_text to minimize code duplication between this code and query.rb.

Note: I haven't checked if this code works. I changed it in Github editor