<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -110,7 +110,7 @@ For example:
       @http_method  = http_method
       @data         = data
 
-      request_page(response.location, :get, data) if response.redirect?
+      request_page(response.location, :get, data) if redirect?
 
       return response
     end
@@ -118,6 +118,10 @@ For example:
     def success_code? #:nodoc:
       (200..499).include?(response_code)
     end
+    
+    def redirect? #:nodoc:
+      response_code / 100 == 3
+    end
 
     def exception_caught? #:nodoc:
       response_body =~ /Exception caught/</diff>
      <filename>lib/webrat/core/session.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,7 +12,7 @@ module Webrat #:nodoc:
     end
 
     def response
-      @response ||= TestResponse.new
+      @response ||= Object.new
     end
 
     def response_code
@@ -31,10 +31,4 @@ module Webrat #:nodoc:
     def delete(url, data, headers = nil)
     end
   end
-  
-  class TestResponse #:nodoc:
-    def redirect?
-      false
-    end
-  end
 end
\ No newline at end of file</diff>
      <filename>spec/fakes/test_session.rb</filename>
    </modified>
    <modified>
      <diff>@@ -114,7 +114,7 @@ describe Webrat::Session do
     end
 
     it &quot;should follow redirects&quot; do
-      webrat_session.response.should_receive(:redirect?).twice.and_return(true, false)
+      webrat_session.should_receive(:redirect?).twice.and_return(true, false)
       webrat_session.response.should_receive(:location).once.and_return(&quot;/newurl&quot;)
 
       webrat_session.request_page(&quot;/oldurl&quot;, :get, {})
@@ -122,4 +122,20 @@ describe Webrat::Session do
       webrat_session.current_url.should == &quot;/newurl&quot;
     end
   end
+
+  describe &quot;#redirect?&quot; do
+    before(:each) do
+      webrat_session = Webrat::Session.new
+    end
+
+    it &quot;should return true if the last response was a redirect&quot; do
+      webrat_session.stub!(:response_code =&gt; 301)
+      webrat_session.redirect?.should be_true
+    end
+
+    it &quot;should return false if the last response wasn't a redirect&quot; do
+      webrat_session.stub!(:response_code =&gt; 200)
+      webrat_session.redirect?.should be_false
+    end
+  end
 end
\ No newline at end of file</diff>
      <filename>spec/private/core/session_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -24,7 +24,7 @@ describe &quot;click_area&quot; do
     webrat_session.response_code = 501
     lambda { click_area &quot;Berlin&quot; }.should raise_error(Webrat::PageLoadError)
   end
-  
+
   [200, 300, 400, 499].each do |status|
     it &quot;should consider the #{status} status code as success&quot; do
       with_html &lt;&lt;-HTML
@@ -34,11 +34,12 @@ describe &quot;click_area&quot; do
         &lt;/map&gt;
         &lt;/html&gt;
       HTML
+      webrat_session.stub!(:redirect? =&gt; false)
       webrat_session.response_code = status
       lambda { click_area &quot;Berlin&quot; }.should_not raise_error
     end
   end
-  
+
   it &quot;should fail if the area doesn't exist&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -47,12 +48,12 @@ describe &quot;click_area&quot; do
       &lt;/map&gt;
       &lt;/html&gt;
     HTML
-    
+
     lambda {
       click_area &quot;Missing area&quot;
     }.should raise_error(Webrat::NotFoundError)
   end
-  
+
   it &quot;should not be case sensitive&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -64,7 +65,7 @@ describe &quot;click_area&quot; do
     webrat_session.should_receive(:get).with(&quot;/page&quot;, {})
     click_area &quot;berlin&quot;
   end
-  
+
 
   it &quot;should follow relative links&quot; do
     webrat_session.stub!(:current_url =&gt; &quot;/page&quot;)
@@ -78,7 +79,7 @@ describe &quot;click_area&quot; do
     webrat_session.should_receive(:get).with(&quot;/page/sub&quot;, {})
     click_area &quot;Berlin&quot;
   end
-  
+
   it &quot;should follow fully qualified local links&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;</diff>
      <filename>spec/public/click_area_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,10 +7,10 @@ describe &quot;click_button&quot; do
       &lt;form method=&quot;get&quot; action=&quot;/login&quot;&gt;&lt;/form&gt;
       &lt;/html&gt;
     HTML
-    
+
     lambda { click_button }.should raise_error(Webrat::NotFoundError)
   end
-  
+
   it &quot;should fail if input is not a submit button&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -23,7 +23,7 @@ describe &quot;click_button&quot; do
     lambda { click_button }.should raise_error(Webrat::NotFoundError)
   end
 
-  
+
   it &quot;should fail if button is disabled&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -35,7 +35,7 @@ describe &quot;click_button&quot; do
 
     lambda { click_button }.should raise_error(Webrat::DisabledFieldError)
   end
-  
+
   it &quot;should default to get method&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -47,7 +47,7 @@ describe &quot;click_button&quot; do
     webrat_session.should_receive(:get)
     click_button
   end
-  
+
   it &quot;should assert valid response&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -59,7 +59,7 @@ describe &quot;click_button&quot; do
     webrat_session.response_code = 501
     lambda { click_button }.should raise_error(Webrat::PageLoadError)
   end
-  
+
   [200, 300, 400, 499].each do |status|
     it &quot;should consider the #{status} status code as success&quot; do
       with_html &lt;&lt;-HTML
@@ -69,11 +69,12 @@ describe &quot;click_button&quot; do
         &lt;/form&gt;
         &lt;/html&gt;
       HTML
+      webrat_session.stub!(:redirect? =&gt; false)
       webrat_session.response_code = status
       lambda { click_button }.should_not raise_error
     end
   end
-  
+
   it &quot;should submit the first form by default&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -88,7 +89,7 @@ describe &quot;click_button&quot; do
     webrat_session.should_receive(:get).with(&quot;/form1&quot;, {})
     click_button
   end
-  
+
   it &quot;should not explode on file fields&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -100,7 +101,7 @@ describe &quot;click_button&quot; do
     HTML
     click_button
   end
-  
+
   it &quot;should submit the form with the specified button&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -115,7 +116,7 @@ describe &quot;click_button&quot; do
     webrat_session.should_receive(:get).with(&quot;/form2&quot;, {})
     click_button &quot;Form2&quot;
   end
-  
+
   it &quot;should use action from form&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -127,7 +128,7 @@ describe &quot;click_button&quot; do
     webrat_session.should_receive(:get).with(&quot;/login&quot;, {})
     click_button
   end
-  
+
   it &quot;should use method from form&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -139,7 +140,7 @@ describe &quot;click_button&quot; do
     webrat_session.should_receive(:post)
     click_button
   end
-  
+
   it &quot;should send button as param if it has a name&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -152,7 +153,7 @@ describe &quot;click_button&quot; do
     webrat_session.should_receive(:post).with(&quot;/login&quot;, &quot;login&quot; =&gt; &quot;Login&quot;)
     click_button(&quot;Login&quot;)
   end
-  
+
   it &quot;should not send button as param if it has no name&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -177,8 +178,8 @@ describe &quot;click_button&quot; do
     HTML
     webrat_session.should_receive(:get).with(&quot;/login&quot;, &quot;user&quot; =&gt; {&quot;password&quot; =&gt; &quot;mypass&quot;})
     click_button
-  end  
-  
+  end
+
   it &quot;should send default hidden field values&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -191,7 +192,7 @@ describe &quot;click_button&quot; do
     webrat_session.should_receive(:get).with(&quot;/login&quot;, &quot;user&quot; =&gt; {&quot;email&quot; =&gt; &quot;test@example.com&quot;})
     click_button
   end
-  
+
   it &quot;should send default text field values&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -204,7 +205,7 @@ describe &quot;click_button&quot; do
     webrat_session.should_receive(:get).with(&quot;/login&quot;, &quot;user&quot; =&gt; {&quot;email&quot; =&gt; &quot;test@example.com&quot;})
     click_button
   end
-  
+
   it &quot;should not send disabled field values&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -221,7 +222,7 @@ describe &quot;click_button&quot; do
     webrat_session.should_receive(:get).with(&quot;/login&quot;, {})
     click_button
   end
-  
+
   it &quot;should send default checked fields&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -234,7 +235,7 @@ describe &quot;click_button&quot; do
     webrat_session.should_receive(:get).with(&quot;/login&quot;, &quot;user&quot; =&gt; {&quot;tos&quot; =&gt; &quot;1&quot;})
     click_button
   end
-  
+
   it &quot;should send default radio options&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -250,7 +251,7 @@ describe &quot;click_button&quot; do
     webrat_session.should_receive(:get).with(&quot;/login&quot;, &quot;user&quot; =&gt; {&quot;gender&quot; =&gt; &quot;F&quot;})
     click_button
   end
-  
+
   it &quot;should send correct data for rails style unchecked fields&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -264,7 +265,7 @@ describe &quot;click_button&quot; do
     webrat_session.should_receive(:get).with(&quot;/login&quot;, &quot;user&quot; =&gt; {&quot;tos&quot; =&gt; &quot;0&quot;})
     click_button
   end
-  
+
   it &quot;should send correct data for rails style checked fields&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -302,7 +303,7 @@ describe &quot;click_button&quot; do
       &quot;response&quot; =&gt; { &quot;choices&quot; =&gt; [{&quot;selected&quot; =&gt; &quot;one&quot;}, {&quot;selected&quot; =&gt; &quot;two&quot;}, {&quot;selected&quot; =&gt; &quot;two&quot;}]})
     click_button
   end
-  
+
   it &quot;should not send default unchecked fields&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -315,7 +316,7 @@ describe &quot;click_button&quot; do
     webrat_session.should_receive(:get).with(&quot;/login&quot;, {})
     click_button
   end
-  
+
   it &quot;should send default textarea values&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -328,7 +329,7 @@ describe &quot;click_button&quot; do
     webrat_session.should_receive(:post).with(&quot;/posts&quot;, &quot;post&quot; =&gt; {&quot;body&quot; =&gt; &quot;Post body here!&quot;})
     click_button
   end
-  
+
   it &quot;should properly handle HTML entities in textarea default values&quot; do
     spec = lambda do
       with_html &lt;&lt;-HTML
@@ -342,14 +343,14 @@ describe &quot;click_button&quot; do
       webrat_session.should_receive(:post).with(&quot;/posts&quot;, &quot;post&quot; =&gt; {&quot;body&quot; =&gt; &quot;Peanut butter &amp; jelly&quot;})
       click_button
     end
-    
+
     if Webrat.on_java?
       spec.call
     else
       pending(&quot;needs bug fix&quot;, &amp;spec)
     end
   end
-  
+
   it &quot;should send default selected option value from select&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -381,7 +382,7 @@ describe &quot;click_button&quot; do
     webrat_session.should_receive(:get).with(&quot;/login&quot;, &quot;month&quot; =&gt; &quot;February&quot;)
     click_button
   end
-  
+
   it &quot;should send first select option value when no option selected&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -397,7 +398,7 @@ describe &quot;click_button&quot; do
     webrat_session.should_receive(:get).with(&quot;/login&quot;, &quot;month&quot; =&gt; &quot;1&quot;)
     click_button
   end
-  
+
   it &quot;should handle nested properties&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -449,7 +450,7 @@ describe &quot;click_button&quot; do
     webrat_session.should_receive(:get)
     click_button
   end
-  
+
   it &quot;should find buttons by their IDs&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -461,7 +462,7 @@ describe &quot;click_button&quot; do
     webrat_session.should_receive(:get)
     click_button &quot;my_button&quot;
   end
-  
+
   it &quot;should find image buttons by their alt text&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;</diff>
      <filename>spec/public/click_button_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,7 +10,7 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:get).with(&quot;/page&quot;, {})
     click_link &quot;Save &amp; go back&quot;
   end
-  
+
   it &quot;should use get by default&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -30,7 +30,7 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:get).with(&quot;/page&quot;, {})
     click_link &quot;Link text&quot;, :method =&gt; :get
   end
-  
+
   it &quot;should click link on substring&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -40,7 +40,7 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:get).with(&quot;/page&quot;, {})
     click_link &quot;ink tex&quot;, :method =&gt; :get
   end
-  
+
   it &quot;should click delete links&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -50,8 +50,8 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:delete).with(&quot;/page&quot;, {})
     click_link &quot;Link text&quot;, :method =&gt; :delete
   end
-  
-  
+
+
   it &quot;should click post links&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -61,7 +61,7 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:post).with(&quot;/page&quot;, {})
     click_link &quot;Link text&quot;, :method =&gt; :post
   end
-  
+
   it &quot;should click put links&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -71,7 +71,7 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:put).with(&quot;/page&quot;, {})
     click_link &quot;Link text&quot;, :method =&gt; :put
   end
-  
+
   it &quot;should click links by regexp&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -81,8 +81,8 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:get).with(&quot;/page&quot;, {})
     click_link /link [a-z]/i
   end
-  
-  it &quot;should click links by id&quot; do 
+
+  it &quot;should click links by id&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
       &lt;a id=&quot;link_text_link&quot; href=&quot;/page&quot;&gt;Link text&lt;/a&gt;
@@ -91,8 +91,8 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:get).with(&quot;/page&quot;, {})
     click_link &quot;link_text_link&quot;
   end
-  
-  it &quot;should click links by id regexp&quot; do 
+
+  it &quot;should click links by id regexp&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
       &lt;a id=&quot;link_text_link&quot; href=&quot;/page&quot;&gt;Link text&lt;/a&gt;
@@ -101,7 +101,7 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:get).with(&quot;/page&quot;, {})
     click_link /_text_/
   end
-  
+
   it &quot;should click rails javascript links with authenticity tokens&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -122,7 +122,7 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:post).with(&quot;/posts&quot;, &quot;authenticity_token&quot; =&gt; &quot;aa79cb354597a60a3786e7e291ed4f74d77d3a62&quot;)
     click_link &quot;Posts&quot;
   end
-  
+
   it &quot;should click rails javascript delete links&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -143,7 +143,7 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:delete).with(&quot;/posts/1&quot;, {})
     click_link &quot;Delete&quot;
   end
-  
+
   it &quot;should click rails javascript post links&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -159,7 +159,7 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:post).with(&quot;/posts&quot;, {})
     click_link &quot;Posts&quot;
   end
-  
+
   it &quot;should click rails javascript post links without javascript&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -175,7 +175,7 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:get).with(&quot;/posts&quot;, {})
     click_link &quot;Posts&quot;, :javascript =&gt; false
   end
-  
+
   it &quot;should click rails javascript put links&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -196,7 +196,7 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:put).with(&quot;/posts&quot;, {})
     click_link &quot;Put&quot;
   end
-  
+
   it &quot;should fail if the javascript link doesn't have a value for the _method input&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -213,12 +213,12 @@ describe &quot;click_link&quot; do
         return false;&quot;&gt;Link&lt;/a&gt;
       &lt;/html&gt;
     HTML
-    
+
     lambda {
       click_link &quot;Link&quot;
     }.should raise_error(Webrat::WebratError)
   end
-  
+
   it &quot;should assert valid response&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -228,7 +228,7 @@ describe &quot;click_link&quot; do
     webrat_session.response_code = 501
     lambda { click_link &quot;Link text&quot; }.should raise_error(Webrat::PageLoadError)
   end
-  
+
   [200, 300, 400, 499].each do |status|
     it &quot;should consider the #{status} status code as success&quot; do
       with_html &lt;&lt;-HTML
@@ -236,23 +236,24 @@ describe &quot;click_link&quot; do
         &lt;a href=&quot;/page&quot;&gt;Link text&lt;/a&gt;
         &lt;/html&gt;
       HTML
+      webrat_session.stub!(:redirect? =&gt; false)
       webrat_session.response_code = status
       lambda { click_link &quot;Link text&quot; }.should_not raise_error
     end
   end
-  
+
   it &quot;should fail is the link doesn't exist&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
       &lt;a href=&quot;/page&quot;&gt;Link text&lt;/a&gt;
       &lt;/html&gt;
     HTML
-    
+
     lambda {
       click_link &quot;Missing link&quot;
     }.should raise_error(Webrat::NotFoundError)
   end
-  
+
   it &quot;should not be case sensitive&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -262,7 +263,7 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:get).with(&quot;/page&quot;, {})
     click_link &quot;LINK TEXT&quot;
   end
-  
+
   it &quot;should match link substrings&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -272,7 +273,7 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:get).with(&quot;/page&quot;, {})
     click_link &quot;Link text&quot;
   end
-  
+
   it &quot;should work with elements in the link&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -282,7 +283,7 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:get).with(&quot;/page&quot;, {})
     click_link &quot;Link text&quot;
   end
-  
+
   it &quot;should match the first matching link&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -293,7 +294,7 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:get).with(&quot;/page1&quot;, {})
     click_link &quot;Link text&quot;
   end
-  
+
   it &quot;should choose the shortest link text match&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -301,22 +302,22 @@ describe &quot;click_link&quot; do
         &lt;a href=&quot;/page2&quot;&gt;Link&lt;/a&gt;
       &lt;/html&gt;
     HTML
-    
+
     webrat_session.should_receive(:get).with(&quot;/page2&quot;, {})
     click_link &quot;Link&quot;
   end
-  
+
   it &quot;should treat non-breaking spaces as spaces&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
         &lt;a href=&quot;/page1&quot;&gt;This&amp;nbsp;is&amp;nbsp;a&amp;nbsp;link&lt;/a&gt;
       &lt;/html&gt;
     HTML
-    
+
     webrat_session.should_receive(:get).with(&quot;/page1&quot;, {})
     click_link &quot;This is a link&quot;
   end
-  
+
   it &quot;should not match on non-text contents&quot; do
     pending &quot;needs fix&quot; do
       with_html &lt;&lt;-HTML
@@ -325,12 +326,12 @@ describe &quot;click_link&quot; do
         &lt;a href=&quot;/page2&quot;&gt;Location&lt;/a&gt;
         &lt;/html&gt;
       HTML
-    
+
       webrat_session.should_receive(:get).with(&quot;/page2&quot;, {})
       click_link &quot;Location&quot;
     end
   end
-  
+
   it &quot;should click link within a selector&quot; do
     with_html &lt;&lt;-HTML
     &lt;html&gt;
@@ -340,7 +341,7 @@ describe &quot;click_link&quot; do
       &lt;/div&gt;
     &lt;/html&gt;
     HTML
-    
+
     webrat_session.should_receive(:get).with(&quot;/page2&quot;, {})
     click_link_within &quot;#container&quot;, &quot;Link&quot;
   end
@@ -366,7 +367,7 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:get).with(&quot;/page/sub&quot;, {})
     click_link &quot;Jump to sub page&quot;
   end
-  
+
   it &quot;should follow fully qualified local links&quot; do
     webrat_session.stub!(:current_url =&gt; &quot;/page&quot;)
     with_html &lt;&lt;-HTML
@@ -377,7 +378,7 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:get).with(&quot;http://subdomain.example.com/page/sub&quot;, {})
     click_link &quot;Jump to sub page&quot;
   end
-  
+
   it &quot;should follow fully qualified local links to example.com&quot; do
     with_html &lt;&lt;-HTML
       &lt;html&gt;
@@ -398,28 +399,28 @@ describe &quot;click_link&quot; do
     webrat_session.should_receive(:get).with(&quot;/page?foo=bar&quot;, {})
     click_link &quot;Jump to foo bar&quot;
   end
-  
+
   it &quot;should matches_text? on regexp&quot; do
     pending &quot;need to update these&quot;
     link = Webrat::Link.new(webrat_session, nil)
     link.should_receive(:text).and_return(@link_text_with_nbsp)
     link.matches_text?(/link/i).should == 0
   end
-  
+
   it &quot;should matches_text? on link_text&quot; do
     pending &quot;need to update these&quot;
     link = Webrat::Link.new(webrat_session, nil)
     link.should_receive(:text).and_return(@link_text_with_nbsp)
     link.matches_text?(&quot;Link Text&quot;).should == 0
   end
-  
+
   it &quot;should matches_text? on substring&quot; do
     pending &quot;need to update these&quot;
     link = Webrat::Link.new(webrat_session, nil)
     link.should_receive(:text).and_return(@link_text_with_nbsp)
     link.matches_text?(&quot;nk Te&quot;).should_not be_nil
   end
-  
+
   it &quot;should not matches_text? on link_text case insensitive&quot; do
     pending &quot;need to update these&quot;
     link = Webrat::Link.new(webrat_session, nil)
@@ -428,15 +429,15 @@ describe &quot;click_link&quot; do
     link.should_receive(:title).and_return(nil)
     link.matches_text?(&quot;link_text&quot;).should == false
   end
-  
+
   it &quot;should match text not include &amp;nbsp;&quot; do
     pending &quot;need to update these&quot;
     link = Webrat::Link.new(webrat_session, nil)
     link.should_receive(:text).and_return('LinkText')
     link.matches_text?(&quot;LinkText&quot;).should == 0
   end
-  
-  it &quot;should not matches_text? on wrong text&quot; do 
+
+  it &quot;should not matches_text? on wrong text&quot; do
     pending &quot;need to update these&quot;
     link = Webrat::Link.new(webrat_session, nil)
     nbsp = [0xA0].pack(&quot;U&quot;)
@@ -464,5 +465,5 @@ describe &quot;click_link&quot; do
     link.should_receive(:inner_html).and_return('&lt;img src=&quot;logo.png&quot; /&gt;')
     link.matches_text?('logo.png').should == 10
   end
-  
+
 end</diff>
      <filename>spec/public/click_link_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,6 +21,7 @@ describe &quot;visit&quot; do
 
   [200, 300, 400, 499].each do |status|
     it &quot;should consider the #{status} status code as success&quot; do
+      webrat_session.stub!(:redirect? =&gt; false)
       webrat_session.response_code = status
       lambda { visit(&quot;/&quot;) }.should_not raise_error
     end
@@ -31,7 +32,7 @@ describe &quot;visit&quot; do
   end
 
   it &quot;should follow redirects&quot; do
-    webrat_session.response.should_receive(:redirect?).twice.and_return(true, false)
+    webrat_session.should_receive(:redirect?).twice.and_return(true, false)
     webrat_session.response.should_receive(:location).once.and_return(&quot;/newurl&quot;)
 
     visit(&quot;/oldurl&quot;)</diff>
      <filename>spec/public/visit_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b222d3fde3983b4fe7f8dfa0f0c3959494e3a149</id>
    </parent>
  </parents>
  <author>
    <name>Josh Knowles</name>
    <email>joshknowles@gmail.com</email>
  </author>
  <url>http://github.com/brynary/webrat/commit/e77495bc04cacfb1e7684bd938a7c6d32545130f</url>
  <id>e77495bc04cacfb1e7684bd938a7c6d32545130f</id>
  <committed-date>2008-12-29T19:45:55-08:00</committed-date>
  <authored-date>2008-12-29T19:45:55-08:00</authored-date>
  <message>Refactor redirect handling as Merb response doesn't support the redirect? method.  All integration specs now passing again.</message>
  <tree>acba813b4992b9ef522700013ac13c3c991b54c1</tree>
  <committer>
    <name>Josh Knowles</name>
    <email>joshknowles@gmail.com</email>
  </committer>
</commit>
