require File.expand_path(File.dirname(__FILE__) + "/../spec_helper") describe "within" do before do @session = Webrat::TestSession.new end it "should work when nested" do @session.response_body = <<-EOS
Link
Link
EOS @session.should_receive(:get).with("/page2", {}) @session.within "#container" do @session.within "div" do @session.click_link "Link" end end end it "should click links within a scope" do @session.response_body = <<-EOS Link
Link
EOS @session.should_receive(:get).with("/page2", {}) @session.within "#container" do @session.click_link "Link" end end it "should submit forms within a scope" do @session.response_body = <<-EOS