- Remove extra period in the invisible text details message
- Add error validation test that requires :js for when text is changed by `text-transform` css
- When asserting on text that is changed via css in a test that
requires :js, the test must assert how the text exactly looks on the
page, not just in HTML
- Discrepancy between pure html and actual output on page
- In this case, the text is found using case insensitive text and
including non-visible text
- When those two error detail messages (case insensitive and non-visible) are concatenated, the error
looks off because of the prepended period.
- Remove the prepended period so that the error looks correct
When the text as invalid Regexp is given to `#have_text`, it raises the following error:
``` ruby
expect(page).to have_text('[]') #=> RegexpError: empty char-class: /[]/
```
We expect an error `Capybara::ExpectationNotMet`, not a `RegexpError`.
When testing a page with JS that hides and shows
certain elements, it's useful to know whether a
test failure means that an element has failed to
render, or has rendered but become invisible (or
failed to become visible).
For instance, some jQuery plugins will take
existing elements and hide them, adding some other
elements onto the page that use the originals as
storage. If your tests are written to use the
now-hidden elements they will mysteriously start
failing.
This commit only changes the behavior for failed
tests (rspec and assert) and only for text
queries. It might be nice to extend this to the
other finders.
* Add assert_text, assert_no_text, assert_title, assert_no_title
* Refactor query resolving
* Improve failure messages for have_text, have_title RSpec matchers (they will be the same as for added assert_* methods)
* Add Simple#inspect