From 6b9f34cb61c1169b75c22ff53dd50f7115120eed Mon Sep 17 00:00:00 2001 From: Stormwind Date: Fri, 30 Nov 2012 19:13:41 +0100 Subject: Optional setting of status code on redirect --- spec/unit/response/response_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'spec/unit') diff --git a/spec/unit/response/response_spec.rb b/spec/unit/response/response_spec.rb index 8edc48d..bc5199a 100644 --- a/spec/unit/response/response_spec.rb +++ b/spec/unit/response/response_spec.rb @@ -133,6 +133,14 @@ describe Zero::Response do value[0].should eq(302) value[1]['Location'].should eq('http://foo.bar/relocated/thingy') end + + it "sets the given status code and the given Location" do + subject.redirect('http://foo.bar/relocated/other_thingy', 307) + value = subject.to_a + + value[0].should eq(307) + value[1]['Location'].should eq('http://foo.bar/relocated/other_thingy') + end end end \ No newline at end of file -- cgit v1.2.3-70-g09d2