Moving within to Session

This commit is contained in:
Bryan Helmkamp 2008-07-27 12:48:13 -04:00
parent cc56a855cd
commit cccc8a34f8
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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