Rails Rspec Capybara Testing Javascript

I’m testing a Rails 3 app with Rspec and Capybara.

For my integration tests, I need to test javascript. Of course, I
watched http://railscasts.com/episodes/257-request-specs-and-capybara
which presents the basics very well.

Unfortunately an error is raised in the javascript as I can see using
save_and_open_page

It seems characters are encoded by Capybara or Selenium so this js
loop crashes because of the <:

Reason:

Uncaught SyntaxError: Unexpected token ;

I did put:

in my head so I can’t understand the problem.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs