Moving within to Session
This commit is contained in:
parent
cc56a855cd
commit
cccc8a34f8
@ -24,10 +24,6 @@ module Webrat
|
|||||||
session.current_page = self
|
session.current_page = self
|
||||||
end
|
end
|
||||||
|
|
||||||
def within(selector)
|
|
||||||
yield Scope.new(self, session.response_body, selector)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Reloads the last page requested. Note that this will resubmit forms
|
# Reloads the last page requested. Note that this will resubmit forms
|
||||||
# and their data.
|
# and their data.
|
||||||
#
|
#
|
||||||
@ -44,7 +40,7 @@ module Webrat
|
|||||||
# Example:
|
# Example:
|
||||||
# clicks_link_within "#user_12", "Vote"
|
# clicks_link_within "#user_12", "Vote"
|
||||||
def clicks_link_within(selector, link_text)
|
def clicks_link_within(selector, link_text)
|
||||||
within(selector) do |scope|
|
session.within(selector) do |scope|
|
||||||
scope.clicks_link(link_text)
|
scope.clicks_link(link_text)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -50,6 +50,10 @@ module Webrat
|
|||||||
@current_page = new_page
|
@current_page = new_page
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def within(selector)
|
||||||
|
yield Scope.new(current_page, response_body, selector)
|
||||||
|
end
|
||||||
|
|
||||||
def visits(*args)
|
def visits(*args)
|
||||||
Page.new(self, *args)
|
Page.new(self, *args)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user