public
Description: Webrat - Ruby Acceptance Testing for Web applications
Homepage: http://gitrdoc.com/brynary/webrat/tree/master/
Clone URL: git://github.com/brynary/webrat.git
Fix sinatra spec for redirects
foca (author)
Mon Dec 29 00:05:04 -0800 2008
commit  a058c8e5ccf088917c1e395171ea2f8757c34aa9
tree    e73c04400762e1a0e72ce9f143593e029fb47d5e
parent  422c6aea89310899bceda5d8797d311acafafa84
...
1
2
3
 
4
5
6
...
31
32
33
34
 
35
36
37
38
39
 
40
41
42
...
1
2
 
3
4
5
6
...
31
32
33
 
34
35
36
37
38
 
39
40
41
42
0
@@ -1,6 +1,6 @@
0
 require File.expand_path(File.dirname(__FILE__) + '/helper')
0
 
0
-describe Webrat::SinatraSession do
0
+describe Webrat::SinatraSession, "API" do
0
   before :each do
0
     Webrat.configuration.mode = :sinatra
0
     @sinatra_session = Webrat::SinatraSession.new
0
@@ -31,12 +31,12 @@ describe Webrat::SinatraSession do
0
     @sinatra_session.delete("url", {}, "headers")
0
   end
0
 
0
-  it "should forward headers when following redirects" do
0
+  it "should use Session#request_page to handle redirects" do
0
     @response.should_receive(:redirect?).twice.and_return(true, false)
0
     @response.should_receive(:location).and_return("redirect url")
0
 
0
     @sinatra_session.should_receive(:get_it).with("original url", { :env => "headers" })
0
-    @sinatra_session.should_receive(:get_it).with("redirect url", { :env => "headers" })
0
+    @sinatra_session.should_receive(:request_page).with("redirect url", :get, {})
0
 
0
     @sinatra_session.get("original url", {}, "headers")
0
   end

Comments