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 16 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
browser()
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 22 def browser @browser ||= Capybara::RackTest::Browser.new(self) end
browser_initialized?()
click to toggle source
@deprecated This method is being removed
Calls superclass method
Capybara::Driver::Base#browser_initialized?
# File lib/capybara/rack_test/driver.rb, line 91 def browser_initialized? super && !@browser.nil? end
current_url()
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 54 def current_url browser.current_url end
delete(*args, &block)
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 98 def delete(*args, &block); browser.delete(*args, &block); end
dom()
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 78 def dom browser.dom end
find_css(selector)
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 70 def find_css(selector) browser.find(:css,selector) end
find_xpath(selector)
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 66 def find_xpath(selector) browser.find(:xpath, selector) end
follow(method, path, attributes = {})
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 50 def follow(method, path, attributes = {}) browser.follow(method, path, attributes) end
follow_redirects?()
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 26 def follow_redirects? @options[:follow_redirects] end
get(*args, &block)
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 95 def get(*args, &block); browser.get(*args, &block); end
header(key, value)
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 99 def header(key, value); browser.header(key, value); end
html()
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 74 def html browser.html end
post(*args, &block)
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 96 def post(*args, &block); browser.post(*args, &block); end
put(*args, &block)
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 97 def put(*args, &block); browser.put(*args, &block); end
redirect_limit()
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 30 def redirect_limit @options[:redirect_limit] end
request()
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 38 def request browser.last_request end
reset!()
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 86 def reset! @browser = nil end
response()
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 34 def response browser.last_response end
response_headers()
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 58 def response_headers response.headers end
status_code()
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 62 def status_code response.status end
submit(method, path, attributes)
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 46 def submit(method, path, attributes) browser.submit(method, path, attributes) end
title()
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 82 def title browser.title end
visit(path, attributes = {})
click to toggle source
# File lib/capybara/rack_test/driver.rb, line 42 def visit(path, attributes = {}) browser.visit(path, attributes) end