diff --git a/lib/webrat/core/session.rb b/lib/webrat/core/session.rb index 939771b..41855e1 100644 --- a/lib/webrat/core/session.rb +++ b/lib/webrat/core/session.rb @@ -155,7 +155,7 @@ For example: end def redirect? #:nodoc: - (response_code / 100).to_i == 3 + response_code != 304 && (response_code / 100).to_i == 3 end def internal_redirect? diff --git a/spec/private/core/session_spec.rb b/spec/private/core/session_spec.rb index 8f26f46..4e735fb 100644 --- a/spec/private/core/session_spec.rb +++ b/spec/private/core/session_spec.rb @@ -133,6 +133,11 @@ describe Webrat::Session do webrat_session.stub!(:response_code => 200) webrat_session.redirect?.should be_false end + + it "should return false if the last response was a 304 Not Modified" do + webrat_session.stub!(:response_code => 304) + webrat_session.redirect?.should be_false + end end describe "#internal_redirect?" do