kucaahbe / rspec-html-matchers

Old school have_tag, with_tag(and more) matchers for rspec 3 (Nokogiri powered)
http://rubygems.org/gems/rspec-html-matchers
MIT License
199 stars 90 forks source link

:text not matching. (?) #16

Closed dogweather closed 11 years ago

dogweather commented 12 years ago

I can't get it to match either a string or regex for text that's plainly there. Should I submit a test case?

kucaahbe commented 12 years ago

yes, test case would be nice

ebarendt commented 11 years ago

We have this problem too and narrowed it down to matching a string with two spaces.

kucaahbe commented 11 years ago

I'm not sure what the problem is, could you submit an example of failing test?

As I understand you want to match tag's content exactly as it is in tag, but due to implementation white spaces are "ignored" in matching, "ignored" means that multiple white spaces are interpreted as one. Exceptions are only "pre" and "textarea" tags. This behavior is attempt to mimic browser's handling of whitespaces. Also, please, take a look at this test and it's asset for more info.

Also any testcase/code with description will be appreciated. Thank you.

kucaahbe commented 11 years ago

Removed dealing with whitespaces, from 0.4.0 text matching performed against actual text in template/view. Reopen if have any issues.