Skip to content

Commit 50c2b76

Browse files
author
Sam Phippen
committed
Use 308 instead of 333 as our redirect response code.
Rack uses [this filter](https://github.com/rack/rack/blob/master/lib/rack/response.rb#L132) to define `redirect?` which means that 333 will not be considered a redirect code and therefore a bunch of specs are failing. This replaces that code everywhere with 308.
1 parent ef3fd60 commit 50c2b76

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spec/rspec/rails/matchers/have_http_status_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,12 +382,12 @@ def create_response(opts = {})
382382
it_behaves_like "supports different response instances" do
383383
subject(:matcher) { have_redirect_status }
384384

385-
let(:code) { 333 }
385+
let(:code) { 308 }
386386
end
387387

388388
describe "matching a response" do
389389
it "returns true for a response with a 3xx status code" do
390-
any_3xx_code = 333
390+
any_3xx_code = 308
391391
response = create_response(:status => any_3xx_code)
392392

393393
expect( have_redirect_status.matches?(response) ).to be(true)
@@ -416,12 +416,12 @@ def create_response(opts = {})
416416
end
417417

418418
it "has a negated failure message reporting the expected and actual status codes" do
419-
any_3xx_code = 333
419+
any_3xx_code = 308
420420
response = create_response(:status => any_3xx_code)
421421

422422
expect{ have_redirect_status.matches? response }.
423423
to change(have_redirect_status, :failure_message_when_negated).
424-
to(/not to have a redirect status code \(3xx\) but it was 333/)
424+
to(/not to have a redirect status code \(3xx\) but it was 308/)
425425
end
426426
end
427427

0 commit comments

Comments
 (0)