Class: Capybara::RackTest::Driver
Instance Attribute Summary collapse
Instance Method Summary
collapse
-
#body ⇒ Object
-
#browser ⇒ Object
-
#current_url ⇒ Object
-
#delete(*args, &block) ⇒ Object
-
#dom ⇒ Object
-
#find(selector) ⇒ Object
-
#follow(method, path, attributes = {}) ⇒ Object
-
#get(*args, &block) ⇒ Object
-
#header(key, value) ⇒ Object
-
#initialize(app, options = {}) ⇒ Driver
constructor
A new instance of Driver.
-
#post(*args, &block) ⇒ Object
-
#put(*args, &block) ⇒ Object
-
#request ⇒ Object
-
#reset! ⇒ Object
-
#response ⇒ Object
-
#response_headers ⇒ Object
-
#source ⇒ Object
-
#status_code ⇒ Object
-
#submit(method, path, attributes) ⇒ Object
-
#visit(path, attributes = {}) ⇒ Object
#evaluate_script, #execute_script, #has_shortcircuit_timeout?, #wait?, #wait_until, #within_frame, #within_window
Constructor Details
#initialize(app, options = {}) ⇒ Driver
Returns a new instance of Driver.
10
11
12
13
14
|
# File 'lib/capybara/rack_test/driver.rb', line 10
def initialize(app, options={})
raise ArgumentError, "rack-test requires a rack application, but none was given" unless app
@app = app
@options = options
end
|
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
8
9
10
|
# File 'lib/capybara/rack_test/driver.rb', line 8
def app
@app
end
|
#options ⇒ Object
Returns the value of attribute options.
8
9
10
|
# File 'lib/capybara/rack_test/driver.rb', line 8
def options
@options
end
|
Instance Method Details
#body ⇒ Object
56
57
58
|
# File 'lib/capybara/rack_test/driver.rb', line 56
def body
browser.body
end
|
#browser ⇒ Object
16
17
18
|
# File 'lib/capybara/rack_test/driver.rb', line 16
def browser
@browser ||= Capybara::RackTest::Browser.new(app, options)
end
|
#current_url ⇒ Object
40
41
42
|
# File 'lib/capybara/rack_test/driver.rb', line 40
def current_url
browser.current_url
end
|
#delete(*args, &block) ⇒ Object
75
|
# File 'lib/capybara/rack_test/driver.rb', line 75
def delete(*args, &block); browser.delete(*args, &block); end
|
#dom ⇒ Object
64
65
66
|
# File 'lib/capybara/rack_test/driver.rb', line 64
def dom
browser.dom
end
|
#find(selector) ⇒ Object
52
53
54
|
# File 'lib/capybara/rack_test/driver.rb', line 52
def find(selector)
browser.find(selector)
end
|
#follow(method, path, attributes = {}) ⇒ Object
36
37
38
|
# File 'lib/capybara/rack_test/driver.rb', line 36
def follow(method, path, attributes = {})
browser.follow(method, path, attributes)
end
|
#get(*args, &block) ⇒ Object
72
|
# File 'lib/capybara/rack_test/driver.rb', line 72
def get(*args, &block); browser.get(*args, &block); end
|
76
|
# File 'lib/capybara/rack_test/driver.rb', line 76
def (key, value); browser.(key, value); end
|
#post(*args, &block) ⇒ Object
73
|
# File 'lib/capybara/rack_test/driver.rb', line 73
def post(*args, &block); browser.post(*args, &block); end
|
#put(*args, &block) ⇒ Object
74
|
# File 'lib/capybara/rack_test/driver.rb', line 74
def put(*args, &block); browser.put(*args, &block); end
|
#request ⇒ Object
24
25
26
|
# File 'lib/capybara/rack_test/driver.rb', line 24
def request
browser.last_request
end
|
#reset! ⇒ Object
68
69
70
|
# File 'lib/capybara/rack_test/driver.rb', line 68
def reset!
@browser = nil
end
|
#response ⇒ Object
20
21
22
|
# File 'lib/capybara/rack_test/driver.rb', line 20
def response
browser.last_response
end
|
44
45
46
|
# File 'lib/capybara/rack_test/driver.rb', line 44
def
response.
end
|
#source ⇒ Object
60
61
62
|
# File 'lib/capybara/rack_test/driver.rb', line 60
def source
browser.source
end
|
#status_code ⇒ Object
48
49
50
|
# File 'lib/capybara/rack_test/driver.rb', line 48
def status_code
response.status
end
|
#submit(method, path, attributes) ⇒ Object
32
33
34
|
# File 'lib/capybara/rack_test/driver.rb', line 32
def submit(method, path, attributes)
browser.submit(method, path, attributes)
end
|
#visit(path, attributes = {}) ⇒ Object
28
29
30
|
# File 'lib/capybara/rack_test/driver.rb', line 28
def visit(path, attributes = {})
browser.visit(path, attributes)
end
|