Sha256: 0a23ecdb24a391c765a5255853bdff82bbdaae7177099cd393dac16f6d9e7ded

Contents?: true

Size: 1.5 KB

Versions: 13

Compression:

Stored size: 1.5 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
# rspeckled.
#
# The same goes for capybara-webkit. It must be required before rspeckled.
#
begin
  require 'capybara/rspec'
  require 'capybara/rails'

  if defined?(Capybara::Driver::Base)
    Capybara.register_driver :chrome do |app|
      Capybara::Selenium::Driver.new(app, :browser => :chrome)
    end

    Capybara.javascript_driver = if defined?(Capybara::Webkit)
                                   :webkit
                                 else
                                   :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
rescue LoadError
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rspeckled-0.0.16 lib/rspeckled/plugins/capybara.rb
rspeckled-0.0.15 lib/rspeckled/plugins/capybara.rb
rspeckled-0.0.14 lib/rspeckled/plugins/capybara.rb
rspeckled-0.0.13 lib/rspeckled/plugins/capybara.rb
rspeckled-0.0.12 lib/rspeckled/plugins/capybara.rb
rspeckled-0.0.11 lib/rspeckled/plugins/capybara.rb
rspeckled-0.0.10 lib/rspeckled/plugins/capybara.rb
rspeckled-0.0.9 lib/rspeckled/plugins/capybara.rb
rspeckled-0.0.8 lib/rspeckled/plugins/capybara.rb
rspeckled-0.0.7 lib/rspeckled/plugins/capybara.rb
rspeckled-0.0.6 lib/rspeckled/plugins/capybara.rb
rspeckled-0.0.5 lib/rspeckled/plugins/capybara.rb
rspeckled-0.0.4 lib/rspeckled/plugins/capybara.rb