Skip to content

Commit c6fe00f

Browse files
committed
Adds Capybara.asset_host
- Loads CSS from running server. Useful when debugging feature tests with `save_and_open_page`.
1 parent a8ca647 commit c6fe00f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: spec/rails_helper.rb

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
require "capybara/rspec"
77
require "capybara/poltergeist"
88
require "capybara-screenshot/rspec"
9+
10+
# This will insert a <base> tag with the asset host into the pages created by
11+
# save_and_open_page, meaning that relative links will be loaded from the
12+
# development server if it is running.
13+
Capybara.asset_host = "http://localhost:4000"
14+
915
# Add additional requires below this line. Rails is not loaded until this point!
1016

1117
# Requires supporting ruby files with custom matchers and macros, etc, in

0 commit comments

Comments
 (0)