class Capybara::RackTest::Driver

Constants

DEFAULT_OPTIONS

Attributes

app[R]
options[R]

Public Class Methods

new(app, options={}) click to toggle source
# File lib/capybara/rack_test/driver.rb, line 13
def initialize(app, options={})
  raise ArgumentError, "rack-test requires a rack application, but none was given" unless app
  @app = app
  @options = DEFAULT_OPTIONS.merge(options)
end

Public Instance Methods

body() click to toggle source
# File lib/capybara/rack_test/driver.rb, line 59
def body
  browser.body
end
browser() click to toggle source
# File lib/capybara/rack_test/driver.rb, line 19
def browser
  @browser ||= Capybara::RackTest::Browser.new(self)
end
current_url() click to toggle source
# File lib/capybara/rack_test/driver.rb, line 43
def current_url
  browser.current_url
end
delete(*args, &block) click to toggle source
# File lib/capybara/rack_test/driver.rb, line 78
def delete(*args, &block); browser.delete(*args, &block); end
dom() click to toggle source
# File lib/capybara/rack_test/driver.rb, line 67
def dom
  browser.dom
end
find(selector) click to toggle source
# File lib/capybara/rack_test/driver.rb, line 55
def find(selector)
  browser.find(selector)
end
follow(method, path, attributes = {}) click to toggle source
# File lib/capybara/rack_test/driver.rb, line 39
def follow(method, path, attributes = {})
  browser.follow(method, path, attributes)
end
get(*args, &block) click to toggle source
# File lib/capybara/rack_test/driver.rb, line 75
def get(*args, &block); browser.get(*args, &block); end
header(key, value) click to toggle source
# File lib/capybara/rack_test/driver.rb, line 79
def header(key, value); browser.header(key, value); end
post(*args, &block) click to toggle source
# File lib/capybara/rack_test/driver.rb, line 76
def post(*args, &block); browser.post(*args, &block); end
put(*args, &block) click to toggle source
# File lib/capybara/rack_test/driver.rb, line 77
def put(*args, &block); browser.put(*args, &block); end
request() click to toggle source
# File lib/capybara/rack_test/driver.rb, line 27
def request
  browser.last_request
end
reset!() click to toggle source
# File lib/capybara/rack_test/driver.rb, line 71
def reset!
  @browser = nil
end
response() click to toggle source
# File lib/capybara/rack_test/driver.rb, line 23
def response
  browser.last_response
end
response_headers() click to toggle source
# File lib/capybara/rack_test/driver.rb, line 47
def response_headers
  response.headers
end
source() click to toggle source
# File lib/capybara/rack_test/driver.rb, line 63
def source
  browser.source
end
status_code() click to toggle source
# File lib/capybara/rack_test/driver.rb, line 51
def status_code
  response.status
end
submit(method, path, attributes) click to toggle source
# File lib/capybara/rack_test/driver.rb, line 35
def submit(method, path, attributes)
  browser.submit(method, path, attributes)
end
visit(path, attributes = {}) click to toggle source
# File lib/capybara/rack_test/driver.rb, line 31
def visit(path, attributes = {})
  browser.visit(path, attributes)
end