Class: Capybara::Driver::RackTest
- Inherits:
-
Object
- Object
- Capybara::Driver::RackTest
- Includes:
- Rack::Test::Methods
- Defined in:
- lib/capybara/driver/rack_test_driver.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#html ⇒ Object
readonly
Returns the value of attribute html.
Instance Method Summary collapse
- #find(selector) ⇒ Object
-
#initialize(app) ⇒ RackTest
constructor
A new instance of RackTest.
- #submit(path, attributes) ⇒ Object
- #visit(path) ⇒ Object
Constructor Details
#initialize(app) ⇒ RackTest
Returns a new instance of RackTest.
124 125 126 |
# File 'lib/capybara/driver/rack_test_driver.rb', line 124 def initialize(app) @app = app end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
119 120 121 |
# File 'lib/capybara/driver/rack_test_driver.rb', line 119 def app @app end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
119 120 121 |
# File 'lib/capybara/driver/rack_test_driver.rb', line 119 def body @body end |
#html ⇒ Object (readonly)
Returns the value of attribute html.
119 120 121 |
# File 'lib/capybara/driver/rack_test_driver.rb', line 119 def html @html end |
Instance Method Details
#find(selector) ⇒ Object
140 141 142 |
# File 'lib/capybara/driver/rack_test_driver.rb', line 140 def find(selector) html.xpath(selector).map { |node| Node.new(self, node) } end |
#submit(path, attributes) ⇒ Object
134 135 136 137 138 |
# File 'lib/capybara/driver/rack_test_driver.rb', line 134 def submit(path, attributes) post(path, attributes) follow_redirect! while response.redirect? cache_body end |
#visit(path) ⇒ Object
128 129 130 131 132 |
# File 'lib/capybara/driver/rack_test_driver.rb', line 128 def visit(path) get(path) follow_redirect! while response.redirect? cache_body end |