Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap-rubygem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'test/support/dummy_rails_integration.rb')
-rw-r--r--test/support/dummy_rails_integration.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/support/dummy_rails_integration.rb b/test/support/dummy_rails_integration.rb
new file mode 100644
index 0000000..8ea0bd2
--- /dev/null
+++ b/test/support/dummy_rails_integration.rb
@@ -0,0 +1,22 @@
+require 'capybara'
+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