Sha256: d2ac0fe62437ac917d0111643f9bc5f63a87f72d8a22f9e61adff310f77cff56

Contents?: true

Size: 703 Bytes

Versions: 1

Compression:

Stored size: 703 Bytes

Contents

ENV["RAILS_ENV"] = "test"
require File.expand_path("../dummy/config/environment.rb",  __FILE__)

Rails.backtrace_cleaner.remove_silencers!

require 'rspec/rails'
require 'capybara/rspec'
require 'capybara/poltergeist'
require 'rspec-html-matchers'
require 'active_support/all'
require 'dvl/core'

Capybara.javascript_driver = :poltergeist

def take_screenshot(path, name, opts = {})
  describe "taking screenshot: #{name}.png" do
    before do
      page.driver.resize(opts[:res_x] || 900, opts[:res_y] || 500)
    end

    it 'works' do
      visit path
      self.instance_eval(&opts[:before]) if opts[:before]
      page.save_screenshot "screenshots/#{name}.png", opts.slice(:full)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dvl-core-0.1.0 spec/spec_helper.rb