diff --git a/lib/capybara-screenshot.rb b/lib/capybara-screenshot.rb index 0a94883..db987ba 100644 --- a/lib/capybara-screenshot.rb +++ b/lib/capybara-screenshot.rb @@ -52,7 +52,7 @@ def self.filename_prefix_for(test_type, test) end def self.capybara_root - @capybara_root ||= if defined?(::Rails) + @capybara_root ||= if defined?(::Rails) && Rails.root.present? ::Rails.root.join capybara_tmp_path elsif defined?(Padrino) File.expand_path(capybara_tmp_path, Padrino.root)