class Object

Public Class Methods

feature(*args, &block) click to toggle source
# File lib/capybara/rspec/features.rb, line 15
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)

  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]
  @session.current_url.chomp('?').should == "#{scheme}://#{s.host}:#{s.port}#{path}"
  @session.current_host.should == "#{scheme}://#{s.host}" # no port
  @session.current_path.should == path
  if path == '/host'
    # Server should agree with us
    @session.should have_content("Current host is #{scheme}://#{s.host}:#{s.port}")
  end
end