Expose current DOM (as an Hpricot object) as current_dom. Fix SSL support
This commit is contained in:
parent
f0ffd19be1
commit
549f462f65
|
@ -10,6 +10,7 @@
|
|||
|
||||
* Minor enhancements
|
||||
|
||||
* Expose current DOM (as an Hpricot object) as current_dom
|
||||
* Add support for disabling JavaScript when clicking a link to enable testing of both JS
|
||||
and non-JS implementations (Luke Melia and Bryan Helmkamp)
|
||||
* Support  's as spaces in matching link text (Patch from Luke Melia)
|
||||
|
|
|
@ -162,6 +162,18 @@ module Webrat
|
|||
|
||||
alias_method :click_button, :clicks_button
|
||||
|
||||
def dom # :nodoc:
|
||||
return @dom if defined?(@dom) && @dom
|
||||
@dom = Hpricot(@html)
|
||||
|
||||
if @selector
|
||||
html = (@dom / @selector).first.to_html
|
||||
@dom = Hpricot(html)
|
||||
end
|
||||
|
||||
return @dom
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def find_select_option(option_text, id_or_name_or_label)
|
||||
|
@ -224,17 +236,5 @@ module Webrat
|
|||
end
|
||||
end
|
||||
|
||||
def dom # :nodoc:
|
||||
return @dom if defined?(@dom) && @dom
|
||||
@dom = Hpricot(@html)
|
||||
|
||||
if @selector
|
||||
html = (@dom / @selector).first.to_html
|
||||
@dom = Hpricot(html)
|
||||
end
|
||||
|
||||
return @dom
|
||||
end
|
||||
|
||||
end
|
||||
end
|
|
@ -30,6 +30,10 @@ module Webrat
|
|||
open_in_browser(filename)
|
||||
end
|
||||
|
||||
def current_dom
|
||||
current_scope.dom
|
||||
end
|
||||
|
||||
# For backwards compatibility -- removing in 1.0
|
||||
def current_page
|
||||
page = OpenStruct.new
|
||||
|
|
|
@ -15,18 +15,22 @@ module Webrat
|
|||
end
|
||||
|
||||
def get(url, data)
|
||||
update_protocol(url)
|
||||
@integration_session.get_via_redirect(url, data)
|
||||
end
|
||||
|
||||
def post(url, data)
|
||||
update_protocol(url)
|
||||
@integration_session.post_via_redirect(url, data)
|
||||
end
|
||||
|
||||
def put(url, data)
|
||||
update_protocol(url)
|
||||
@integration_session.put_via_redirect(url, data)
|
||||
end
|
||||
|
||||
def delete(url, data)
|
||||
update_protocol(url)
|
||||
@integration_session.delete_via_redirect(url, data)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue