Sha256: ed60bb76b2175c89b6615b0220ee284cd42ce9f0edb4a47f4f88718e1e3ef40d
Contents?: true
Size: 629 Bytes
Versions: 21
Compression:
Stored size: 629 Bytes
Contents
require 'capybara/dsl' require 'fileutils' module DummyRailsIntegration include Capybara::DSL def setup super cleanup_dummy_rails_files end def teardown super cleanup_dummy_rails_files Capybara.reset_sessions! Capybara.use_default_driver end def screenshot! path = "tmp/#{name}.png" page.driver.render(File.join(GEM_PATH, path), full: true) STDERR.puts "Screenshot saved to #{path}" end private def cleanup_dummy_rails_files FileUtils.rm_rf('test/dummy_rails/tmp/cache', secure: true) FileUtils.rm Dir.glob('test/dummy_rails/public/assets/{.[^\.]*,*}') end end
Version data entries
21 entries across 21 versions & 3 rubygems