Skip to content

Commit 64cd524

Browse files
committed
Fix spurious warnings in tests when using Rack 3.1
These warnings are of the form: ``` warning: input stream used for POST parsing different from current input stream. Starting in Rack 3.2, Rack will used the cached POST value instead of parsing the current in put stream. ``` These warnings are spurious, because tests don't fail on the rack master branch. They occur because the requests inside the FAKE_APP used in the tests have rack.input as a Rack::Lint:InputWrapper instance, while the InputRewinder used in the tests replaces this with the original instance after receiving the response. Then when last_request.POST is called after the request, you get the warning because rack.request.form_input doesn't match rack.input. Deleting rack.request.form_hash from the environment fixes this. The tests that call last_request.POST will reparse the input body instead of using the cached input, but that doesn't seem like a problem.
1 parent e5e9d89 commit 64cd524

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

spec/fixtures/fake_app.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def call(env)
143143
if input
144144
input.rewind
145145
env['rack.input'] = input
146+
env.delete('rack.request.form_hash')
146147
end
147148
end
148149
end

0 commit comments

Comments
 (0)