Webrat::Core::Session#redirect? should not mistake a 304 for a redirect.
This commit is contained in:
parent
0bbf163d4f
commit
fd944cccb5
@ -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?
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user