Skip to content

Commit

Permalink
Fix sinatra spec for redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
foca committed Dec 29, 2008
1 parent 422c6ae commit a058c8e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 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
Expand Down Expand Up @@ -31,12 +31,12 @@
@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
Expand Down

0 comments on commit a058c8e

Please sign in to comment.