From c7798dee5639344c108510282fed49829fc9f38c Mon Sep 17 00:00:00 2001 From: Christopher Schramm Date: Tue, 7 Jan 2014 18:32:36 +0100 Subject: [PATCH] Improve save_page for binary content --- lib/capybara/session.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/capybara/session.rb b/lib/capybara/session.rb index 68601353..edf53a01 100644 --- a/lib/capybara/session.rb +++ b/lib/capybara/session.rb @@ -354,7 +354,7 @@ module Capybara FileUtils.mkdir_p(File.dirname(path)) - File.open(path,'w') { |f| f.write(Capybara::Helpers.inject_asset_host(body)) } + File.open(path,'wb') { |f| f.write(Capybara::Helpers.inject_asset_host(body)) } path end