Thursday, March 26, 2015

Using local assets with save_and_open_page

Previously I talked about how to use save_and_open_page with Cucumber. Unfortunately, when you do this it renders an unstyled page. If you add

Capybara.asset_host = 'http://localhost:3000'

to your spec_helper.rb or Capybara config file, save_and_open_page will use your local server's assets - making it much easier to diagnose issues.