Sha256: 287fc954f7fc80e34b21b08e45acae1362d412fc80e725e0b64a40454f3a0ecd

Contents?: true

Size: 791 Bytes

Versions: 3

Compression:

Stored size: 791 Bytes

Contents

module CucumberCinema
  module ViewSelectStrategy

    def self.take_screenshot?(request)
      return false unless request
      current_shot = "#{request.filtered_parameters["controller"]}-#{request.filtered_parameters["action"]}-#{request.method}"
      if !$cucumber_cinema_screenshots[current_shot]
        $cucumber_cinema_screenshots[current_shot] = 1
        true
      else
        false
      end
    end

    def self.new_movie(options={})
      $cucumber_cinema_screenshots = {}
      $cucumber_cinema_dir_name = "#{Time.new.strftime("%Y%m%d%H%M%S")}"
      $cucumber_cinema_emails = {}
      $cucumber_cinema_location=options[:location] || "#{Rails.root}/tmp/screenshots/"
      $cucumber_cinema_prefix = options[:prefix].present? ? options[:prefix] : "take"
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cucumber-cinema-0.6.2 lib/cucumber_cinema/view_strategy.rb
cucumber-cinema-0.6.1 lib/cucumber_cinema/view_strategy.rb
cucumber-cinema-0.6.0 lib/cucumber_cinema/view_strategy.rb