Sha256: 4c11f611a165da60d8be800a8a3c018d962610fd549f3f8c6a8acddfaacc3300

Contents?: true

Size: 1.29 KB

Versions: 11

Compression:

Stored size: 1.29 KB

Contents

##############################################################################
#                               Capybara Plugin
##############################################################################
#
# This plugin does not attempt to require capybara. It assumes that if you're
# using capybara, you're probably using something like Bundler which has already
# required it for you.
#
# If this is not the case, you will need to require it prior to requiring
# rspectacular.
#
# The same goes for capybara-webkit. It must be required before rspectacular.
#
if defined?(Capybara::Driver::Base)
  Capybara.register_driver :chrome do |app|
    Capybara::Selenium::Driver.new(app, :browser => :chrome)
  end

  if defined?(Capybara::Webkit)
    Capybara.javascript_driver = :webkit
  else
    Capybara.javascript_driver = :selenium
  end

  RSpec.configure do |config|
    config.before(:each, :js => true) do
      page.driver.reset!
    end
  end

  Capybara.configure do |config|
    config.match                  = :prefer_exact
    config.ignore_hidden_elements = true
    config.visible_text_only      = true
  end

  if defined?(Chamber)
    Capybara.default_host = Chamber.env.http.host_with_port
    Capybara.app_host     = Chamber.env.http.base_url
    Capybara.server_port  = Chamber.env.http.port
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rspectacular-0.38.0 lib/rspectacular/plugins/capybara.rb
rspectacular-0.37.0 lib/rspectacular/plugins/capybara.rb
rspectacular-0.36.0 lib/rspectacular/plugins/capybara.rb
rspectacular-0.35.0 lib/rspectacular/plugins/capybara.rb
rspectacular-0.34.0 lib/rspectacular/plugins/capybara.rb
rspectacular-0.33.0 lib/rspectacular/plugins/capybara.rb
rspectacular-0.31.0 lib/rspectacular/plugins/capybara.rb
rspectacular-0.30.0 lib/rspectacular/plugins/capybara.rb
rspectacular-0.29.0 lib/rspectacular/plugins/capybara.rb
rspectacular-0.28.0 lib/rspectacular/plugins/capybara.rb
rspectacular-0.27.0 lib/rspectacular/plugins/capybara.rb