I am visiting a page in my spec using capybara visit
and then clicking another button which is redirecting it to another page. On the third line when I print the current_path
, it still shows the old (first url) rather than the second one. I am using selenium-webdriver for chrome. Any idea on why it is happening?
Edit:
Selenium is opening another browser on line 2 and not redirecting. So, its showing the url of the previous browser and not the current newly opened browser.
Rails 3.2.6
ruby 1.9.3
In the definition of current_path
and current_url
, it says path and url of the current page. Does current page
mean the last browser that was opened?