This commit is contained in:
Thomas Walpole 2014-06-27 16:08:04 -07:00
parent 02f3003601
commit 6e0130ed52
1 changed files with 1 additions and 3 deletions

View File

@ -40,11 +40,9 @@ module Capybara
# @return [String] The modified HTML code
#
def inject_asset_host(html)
if Capybara.asset_host and
Nokogiri::HTML(html).css("base").empty? and
if Capybara.asset_host && Nokogiri::HTML(html).css("base").empty?
match = html.match(/<head[^<]*?>/)
html.clone.insert match.end(0), "<base href='#{Capybara.asset_host}' />"
end
else
html
end