diff options
| -rw-r--r-- | lib/zero/response.rb | 5 | ||||
| -rw-r--r-- | spec/unit/zero/response/redirect_spec.rb | 4 | 
2 files changed, 5 insertions, 4 deletions
| diff --git a/lib/zero/response.rb b/lib/zero/response.rb index 272e5e2..63441e9 100644 --- a/lib/zero/response.rb +++ b/lib/zero/response.rb @@ -85,10 +85,11 @@ module Zero        self.header['Content-Type'] = value      end -    # Sets the Location header to the given URL and the status code to 302. +    # Sets the Location header to the given URL and the status code to +    # 303 - See Other.      #       # @param [String] location Redirect URL -    def redirect(location, status = 302) +    def redirect(location, status = 303)        self.status = status        self.header['Location'] = location      end diff --git a/spec/unit/zero/response/redirect_spec.rb b/spec/unit/zero/response/redirect_spec.rb index 41ec369..ea51668 100644 --- a/spec/unit/zero/response/redirect_spec.rb +++ b/spec/unit/zero/response/redirect_spec.rb @@ -5,11 +5,11 @@ describe Zero::Response do    subject { Zero::Response.new() }    describe '#redirect' do -    it "sets the status to 302 and the given Location URL in header" do +    it "sets the status to 303 and the given Location URL in header" do        subject.redirect 'http://foo.bar/relocated/thingy'        value = subject.to_a -      value[0].should eq(302) +      value[0].should eq(303)        value[1]['Location'].should eq('http://foo.bar/relocated/thingy')      end | 
