jason328 jason328 - 1 year ago 92
Ruby Question

What does page.driver.reset! do?

I'm running a Capybara(poltergeist) test that is sensitive to cached files in the browser. I want to test to ensure that if a user is visiting the page without a cache, they can see a form.

context 'when user on page with empty cache' do
scenario 'sees form' do
visit home_path
# test to see if form exists

My question is this. Does
reset the browser cache?

Answer Source

When using Poltergeist Driver#reset! doesn't clear the browser cache, but as long as you're running Poltergeist 1.10+ you can make sure it's cleared for your test by calling