lib/capybara/sessionkeeper.rb in capybara-sessionkeeper-0.1.4 vs lib/capybara/sessionkeeper.rb in capybara-sessionkeeper-0.1.5
- old
+ new
@@ -11,10 +11,10 @@
File.open(path, 'wb') {|f| f.puts(data) }
path
end
def restore_cookies(path = nil)
- raise CookieError, "visit must be performed to restore cookies" if driver.browser.manage.all_cookies.empty?
+ raise CookieError, "visit must be performed to restore cookies" if ['data:,', 'about:blank'].include?(current_url)
path ||= find_latest_cookie_file
return nil if path.nil?
data = File.open(path, 'rb') {|f| f.read }
Marshal.load(data).each do |d|
begin