Jump to content

The ultimate community for Ruby on Rails developers.


Newby RSpec Gotcha for HTML &

  • Please log in to reply
No replies to this topic

#1 Stuart Hannig

Stuart Hannig


  • Members
  • 15 posts

Posted 26 August 2013 - 07:51 PM

I thought this was an interesting tidbit of information that I'd share with others who are learning.


Ruby and RSpec treat HTML & as just &. So when trying to test for an amperstand in should_have_content or should_have_title tag, use &, not &amp, otherwise it'll throw an error that the test returned false instead of true.


If anyone else has noob gotchas I'd love to hear them.

  • james likes this

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users