Class: Webrat::Link
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from Element
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Element
#initialize, #inspect, load, load_all, #path
Constructor Details
This class inherits a constructor from Webrat::Element
Class Method Details
.xpath_search ⇒ Object
8 9 10 |
# File 'lib/webrat/core/elements/link.rb', line 8 def self.xpath_search ".//a[@href]" end |
Instance Method Details
#click(options = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/webrat/core/elements/link.rb', line 12 def click( = {}) method = [:method] || http_method return if href =~ /^#/ && method == :get [:javascript] = true if [:javascript].nil? if [:javascript] @session.request_page(absolute_href, method, data) else @session.request_page(absolute_href, :get, {}) end end |