Class: Capybara::RackTest::Driver
Constant Summary
collapse
- DEFAULT_OPTIONS =
{
:respect_data_method => true
}
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?, #invalid_element_errors, #wait?, #wait_until, #within_frame, #within_window
Constructor Details
#initialize(app, options = {}) ⇒ Driver
Returns a new instance of Driver.
13
14
15
16
17
|
# 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
|
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
11
12
13
|
# File 'lib/capybara/rack_test/driver.rb', line 11
def app
@app
end
|
#options ⇒ Object
Returns the value of attribute options.
11
12
13
|
# File 'lib/capybara/rack_test/driver.rb', line 11
def options
@options
end
|
Instance Method Details
#body ⇒ Object
59
60
61
|
# File 'lib/capybara/rack_test/driver.rb', line 59
def body
browser.body
end
|
#current_url ⇒ Object
43
44
45
|
# File 'lib/capybara/rack_test/driver.rb', line 43
def current_url
browser.current_url
end
|
#delete(*args, &block) ⇒ Object
78
|
# File 'lib/capybara/rack_test/driver.rb', line 78
def delete(*args, &block); browser.delete(*args, &block); end
|
#dom ⇒ Object
67
68
69
|
# File 'lib/capybara/rack_test/driver.rb', line 67
def dom
browser.dom
end
|
#find(selector) ⇒ Object
55
56
57
|
# File 'lib/capybara/rack_test/driver.rb', line 55
def find(selector)
browser.find(selector)
end
|
#follow(method, path, attributes = {}) ⇒ Object
39
40
41
|
# File 'lib/capybara/rack_test/driver.rb', line 39
def follow(method, path, attributes = {})
browser.follow(method, path, attributes)
end
|
#get(*args, &block) ⇒ Object
75
|
# File 'lib/capybara/rack_test/driver.rb', line 75
def get(*args, &block); browser.get(*args, &block); end
|
79
|
# File 'lib/capybara/rack_test/driver.rb', line 79
def (key, value); browser.(key, value); end
|
#post(*args, &block) ⇒ Object
76
|
# File 'lib/capybara/rack_test/driver.rb', line 76
def post(*args, &block); browser.post(*args, &block); end
|
#put(*args, &block) ⇒ Object
77
|
# File 'lib/capybara/rack_test/driver.rb', line 77
def put(*args, &block); browser.put(*args, &block); end
|
#request ⇒ Object
27
28
29
|
# File 'lib/capybara/rack_test/driver.rb', line 27
def request
browser.last_request
end
|
#reset! ⇒ Object
71
72
73
|
# File 'lib/capybara/rack_test/driver.rb', line 71
def reset!
@browser = nil
end
|
#response ⇒ Object
23
24
25
|
# File 'lib/capybara/rack_test/driver.rb', line 23
def response
browser.last_response
end
|
47
48
49
|
# File 'lib/capybara/rack_test/driver.rb', line 47
def
response.
end
|
#source ⇒ Object
63
64
65
|
# File 'lib/capybara/rack_test/driver.rb', line 63
def source
browser.source
end
|
#status_code ⇒ Object
51
52
53
|
# File 'lib/capybara/rack_test/driver.rb', line 51
def status_code
response.status
end
|
#submit(method, path, attributes) ⇒ Object
35
36
37
|
# File 'lib/capybara/rack_test/driver.rb', line 35
def submit(method, path, attributes)
browser.submit(method, path, attributes)
end
|
#visit(path, attributes = {}) ⇒ Object
31
32
33
|
# File 'lib/capybara/rack_test/driver.rb', line 31
def visit(path, attributes = {})
browser.visit(path, attributes)
end
|