File: dummy_rails_integration.rb

package info (click to toggle)
ruby-bootstrap-sass 3.4.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 1,368 kB
  • sloc: javascript: 3,526; ruby: 1,211; sh: 57; makefile: 9
file content (22 lines) | stat: -rw-r--r-- 448 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'capybara/dsl'
require 'fileutils'
module DummyRailsIntegration
  include Capybara::DSL

  def setup
    super
    FileUtils.rm_rf('test/dummy_rails/tmp/cache', secure: true)
  end

  def teardown
    super
    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
end