diff --git a/lib/webrat/core/session.rb b/lib/webrat/core/session.rb index 49d0ee0..5b5bd63 100644 --- a/lib/webrat/core/session.rb +++ b/lib/webrat/core/session.rb @@ -44,13 +44,9 @@ module Webrat current_page.save_and_open end - def within(selector, &block) - current_page.within(selector, &block) - end - - def method_missing(name, *args) + def method_missing(name, *args, &block) if current_page.respond_to?(name) - current_page.send(name, *args) + current_page.send(name, *args, &block) else super end diff --git a/lib/webrat/rails/session.rb b/lib/webrat/rails/session.rb index 0105d7e..4990efd 100644 --- a/lib/webrat/rails/session.rb +++ b/lib/webrat/rails/session.rb @@ -18,14 +18,10 @@ module ActionController def respond_to?(name) super || webrat_session.respond_to?(name) end - - def within(selector, &block) - webrat_session.within(selector, &block) - end - def method_missing(name, *args) + def method_missing(name, *args, &block) if webrat_session.respond_to?(name) - webrat_session.send(name, *args) + webrat_session.send(name, *args, &block) else super end