From a058c8e5ccf088917c1e395171ea2f8757c34aa9 Mon Sep 17 00:00:00 2001 From: Nicolas Sanguinetti Date: Mon, 29 Dec 2008 06:05:04 -0200 Subject: [PATCH] Fix sinatra spec for redirects --- spec/webrat/sinatra/sinatra_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/webrat/sinatra/sinatra_spec.rb b/spec/webrat/sinatra/sinatra_spec.rb index 64bccc9..06308ac 100644 --- a/spec/webrat/sinatra/sinatra_spec.rb +++ b/spec/webrat/sinatra/sinatra_spec.rb @@ -1,6 +1,6 @@ require File.expand_path(File.dirname(__FILE__) + '/helper') -describe Webrat::SinatraSession do +describe Webrat::SinatraSession, "API" do before :each do Webrat.configuration.mode = :sinatra @sinatra_session = Webrat::SinatraSession.new @@ -31,12 +31,12 @@ describe Webrat::SinatraSession do @sinatra_session.delete("url", {}, "headers") end - it "should forward headers when following redirects" do + it "should use Session#request_page to handle redirects" do @response.should_receive(:redirect?).twice.and_return(true, false) @response.should_receive(:location).and_return("redirect url") @sinatra_session.should_receive(:get_it).with("original url", { :env => "headers" }) - @sinatra_session.should_receive(:get_it).with("redirect url", { :env => "headers" }) + @sinatra_session.should_receive(:request_page).with("redirect url", :get, {}) @sinatra_session.get("original url", {}, "headers") end