The new window cannot call window.opener in its Javascript code.
The problem occurs because Capybara starts the first browser with http://127.0.0.1:57214. But my <a href> points to http://localhost:57214.
They points to different domain names. That's why Firefox does not allow reference between windows.
It is amazing how the problem is not really relevant to Capybara.
Anyway, the way to solve it is to change default domain name of Capybara.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Capybara.server_port = 57124 | |
Capybara.app_host = "http://localhost:#{Capybara.server_port}" |
Put the above lines somewhere in spec_helper.rb