Sha256: ee97134c049db40a18aba40fbd33fe01e8a60224b573e85e669c7481f5f90d24

Contents?: true

Size: 1.44 KB

Versions: 13

Compression:

Stored size: 1.44 KB

Contents

require File.expand_path('../features/session_helpers', __FILE__)
require File.expand_path('../features/javascript', __FILE__)
require File.expand_path('../features/create_works', __FILE__)
require File.expand_path('../curate_fixture_file_upload', __FILE__)

require 'capybara/poltergeist'

Capybara.register_driver :poltergeist_debug do |app|
  Capybara::Poltergeist::Driver.new(app, :inspector => true)
end

module FeatureSupport
  module_function
  def options(default = {type: :feature})
    if ENV['JS']
      Capybara.javascript_driver = default.fetch(:javascript_driver, :poltergeist_debug)
      default[:js] = true
    else
      Capybara.javascript_driver = default.fetch(:javascript_driver, :poltergeist)
    end

    if ENV['LOCAL']
      Capybara.current_driver = default.fetch(:javascript_driver, :poltergeist_debug)
    end
    default
  end
end



RSpec.configure do |config|
  config.include CurateFixtureFileUpload
  config.include Devise::TestHelpers, type: :controller
  config.include Warden::Test::Helpers, type: :feature
  config.include Features::SessionHelpers, type: :feature
  config.include Features::Javascript, type: :feature
  config.include Features::CreateWorks, type: :feature

  config.before(:each, type: :feature) do
    Warden.test_mode!
    @old_resque_inline_value = Resque.inline
    Resque.inline = true
  end

  config.after(:each, type: :feature) do
    Warden.test_reset!
    Resque.inline = @old_resque_inline_value
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
curate-0.6.6 spec/support/features.rb
curate-0.6.5 spec/support/features.rb
curate-0.6.4 spec/support/features.rb
curate-0.6.3 spec/support/features.rb
curate-0.6.1 spec/support/features.rb
curate-0.6.0 spec/support/features.rb
curate-0.5.6 spec/support/features.rb
curate-0.5.5 spec/support/features.rb
curate-0.5.4 spec/support/features.rb
curate-0.5.2 spec/support/features.rb
curate-0.5.1 spec/support/features.rb
curate-0.5.0 spec/support/features.rb
curate-0.4.2 spec/support/features.rb