ybvnqq
Last Updated: February 25, 2016
·
2.393K
· freegenie
Cb8e3a1650513848561ca38f84399fa1

Testing window.location with capybara

Capybara does not follow redirect if the page is changing due to a change in window.location. This is typical in backbone apps.

In capybara current_path only changes after an HTTP redirect.

As a workaround, you can test the content of the destination page.

For example, when writing cucumber steps, if the other page has a "browse" label, you can test it with:

Then I should see "browse"

Instead of:

Then I should be on the browse page
Say Thanks
Respond