Sha256: d1f8b05d1544309dd7517d13b0c481e82223801a0c900d682a468371ffd49260

Contents?: true

Size: 871 Bytes

Versions: 1

Compression:

Stored size: 871 Bytes

Contents

require 'capybara/rspec'
require 'capybara/poltergeist'
require 'rspec-html-matchers'
require 'active_support/all'
require 'erector'
require 'dvl/core'
require_relative '../preview/app'

Capybara.app = App
Capybara.javascript_driver = :poltergeist

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

    it 'works' do
      visit path
      page.save_screenshot "screenshots/#{name}.png", opts
    end
  end
end

def take_flash_screenshot(type, name, res_x = 900, res_y = 150, opts = {})
  describe "taking flash screenshot: #{name}.png" do
    before do
      page.driver.resize(res_x, res_y)
    end

    it 'works' do
      visit '/flashes'
      click_link type
      page.save_screenshot "screenshots/#{name}.png", opts
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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