Webrat::Core::Session#redirect? should not mistake a 304 for a redirect.

This commit is contained in:
Larry Marburger 2010-01-09 10:54:58 -05:00 committed by Damian Janowski
parent 0bbf163d4f
commit fd944cccb5
2 changed files with 6 additions and 1 deletions

View File

@ -155,7 +155,7 @@ For example:
end end
def redirect? #:nodoc: def redirect? #:nodoc:
(response_code / 100).to_i == 3 response_code != 304 && (response_code / 100).to_i == 3
end end
def internal_redirect? def internal_redirect?

View File

@ -133,6 +133,11 @@ describe Webrat::Session do
webrat_session.stub!(:response_code => 200) webrat_session.stub!(:response_code => 200)
webrat_session.redirect?.should be_false webrat_session.redirect?.should be_false
end 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 end
describe "#internal_redirect?" do describe "#internal_redirect?" do