Class: Object

### Home Classes Methods

### In Files

- lib/capybara/rspec.rb
- lib/capybara/rspec/features.rb
- lib/capybara/spec/session/attach_file_spec.rb
- lib/capybara/spec/session/current_url_spec.rb
- lib/capybara/spec/spec_helper.rb

### Parent

BasicObject

### Methods

- ::feature
- #bases
- #should_be_on
- #visit_host_links

### Included Modules

- Capybara::DSL
- Capybara::RSpecMatchers
- Capybara::Features
- File

### Files

- another_test_file.txt
- test_file.txt

### Class/Module Index

Quicksearch

- Capybara
- Capybara::Ambiguous
- Capybara::CapybaraError
- Capybara::DSL
- Capybara::Driver
- Capybara::Driver::Base
- Capybara::Driver::Node
- Capybara::DriverNotFoundError
- Capybara::ElementNotFound
- Capybara::ExpectationNotMet
- Capybara::Features
- Capybara::FileNotFound
- Capybara::FrozenInTime
- Capybara::Helpers
- Capybara::InfiniteRedirectError
- Capybara::ModalNotFound
- Capybara::Node
- Capybara::Node::Actions
- Capybara::Node::Base
- Capybara::Node::Document
- Capybara::Node::DocumentMatchers
- Capybara::Node::Element
- Capybara::Node::Finders
- Capybara::Node::Matchers
- Capybara::Node::Simple
- Capybara::NotSupportedByDriverError
- Capybara::Queries
- Capybara::Queries::BaseQuery
- Capybara::Queries::TextQuery
- Capybara::Queries::TitleQuery
- Capybara::Query
- Capybara::RSpecMatchers
- Capybara::RSpecMatchers::BecomeClosed
- Capybara::RSpecMatchers::HaveSelector
- Capybara::RSpecMatchers::HaveText
- Capybara::RSpecMatchers::HaveTitle
- Capybara::RSpecMatchers::Matcher
- Capybara::RackTest
- Capybara::RackTest::Browser
- Capybara::RackTest::CSSHandlers
- Capybara::RackTest::Driver
- Capybara::RackTest::Form
- Capybara::RackTest::Form::NilUploadedFile
- Capybara::RackTest::Node
- Capybara::ReadOnlyElementError
- Capybara::Result
- Capybara::ScopeError
- Capybara::Selector
- Capybara::Selector::Filter
- Capybara::Selenium
- Capybara::Selenium::Driver
- Capybara::Selenium::Node
- Capybara::Server
- Capybara::Server::Middleware
- Capybara::Session
- Capybara::SpecHelper
- Capybara::UnselectNotAllowed
- Capybara::Window
- Capybara::WindowError
- TestApp
- TestApp::TestAppError
- Object

No matching classes.

# Object

### Public Class Methods

feature(*args, &block) click to toggle source

    # File lib/capybara/rspec/features.rb, line 33
    def self.feature(*args, &block)
      options = if args.last.is_a?(Hash) then args.pop else {} end
      options[:capybara_feature] = true
      options[:type] = :feature
      options[:caller] ||= caller
      args.push(options)

      #call describe on RSpec in case user has expose_dsl_globally set to false
      RSpec.describe(*args, &block)
    end

### Public Instance Methods

bases() click to toggle source

    # File lib/capybara/spec/session/current_url_spec.rb, line 9
    def bases
      @servers.map { |s| "http://#{s.host}:#{s.port}" }
    end

should_be_on(server_index, path="/host", scheme="http") click to toggle source

    # File lib/capybara/spec/session/current_url_spec.rb, line 13
    def should_be_on server_index, path="/host", scheme="http"
      # Check that we are on /host on the given server
      s = @servers[server_index]
      expect(@session.current_url.chomp('?')).to eq("#{scheme}://#{s.host}:#{s.port}#{path}")
      expect(@session.current_host).to eq("#{scheme}://#{s.host}") # no port
      expect(@session.current_path).to eq(path)
      if path == '/host'
        # Server should agree with us
        expect(@session).to have_content("Current host is #{scheme}://#{s.host}:#{s.port}")
      end
    end

visit_host_links() click to toggle source

    # File lib/capybara/spec/session/current_url_spec.rb, line 25
    def visit_host_links
      @session.visit("#{bases[0]}/host_links?absolute_host=#{bases[1]}")
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.