diff --git a/test/support/dummy_rails_integration.rb b/test/support/dummy_rails_integration.rb index 9dbc254f..c1604b16 100644 --- a/test/support/dummy_rails_integration.rb +++ b/test/support/dummy_rails_integration.rb @@ -17,7 +17,9 @@ def teardown def screenshot! path = "tmp/#{name}.png" - page.driver.render(File.join(GEM_PATH, path), full: true) + full_path = File.join(GEM_PATH, path) + FileUtils.mkdir_p(File.dirname(full_path)) + page.driver.render(full_path, full: true) STDERR.puts "Screenshot saved to #{path}" end