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

Version Path
bootstrap-4.3.1 test/support/dummy_rails_integration.rb
bootstrap-4.3.0 test/support/dummy_rails_integration.rb
bootstrap-4.2.1 test/support/dummy_rails_integration.rb
tabler-rubygem-0.1.4 test/support/dummy_rails_integration.rb
bootstrap-4.1.3 test/support/dummy_rails_integration.rb
bootstrap-4.1.2 test/support/dummy_rails_integration.rb
tabler-rubygem-0.1.3 test/support/dummy_rails_integration.rb
loremGem-0.2.0 test/support/dummy_rails_integration.rb
tabler-rubygem-0.1.2 test/support/dummy_rails_integration.rb
bootstrap-4.1.1 test/support/dummy_rails_integration.rb
bootstrap-4.1.0 test/support/dummy_rails_integration.rb
tabler-rubygem-0.1.1 test/support/dummy_rails_integration.rb
bootstrap-4.0.0 test/support/dummy_rails_integration.rb
bootstrap-4.0.0.beta3 test/support/dummy_rails_integration.rb
bootstrap-4.0.0.beta2.1 test/support/dummy_rails_integration.rb
bootstrap-4.0.0.beta2 test/support/dummy_rails_integration.rb
bootstrap-4.0.0.beta test/support/dummy_rails_integration.rb
bootstrap-4.0.0.alpha6 test/support/dummy_rails_integration.rb
bootstrap-4.0.0.alpha5 test/support/dummy_rails_integration.rb
bootstrap-4.0.0.alpha4 test/support/dummy_rails_integration.rb