Skip to content

Commit c59d924

Browse files
samuel-williams-shopifyioquatix
authored andcommitted
Fix test expectation.
1 parent 176f468 commit c59d924

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

test/spec_sendfile.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,13 @@ def open_file(path)
108108
headers = {
109109
'HTTP_X_ACCEL_MAPPING' => "#{tmpdir}/=/foo/bar/"
110110
}
111-
request(headers, sendfile_body, [], 'X-Accel-Redirect') do |response|
111+
body = sendfile_body
112+
expected = Rack::Utils.escape_path(File.expand_path(body.to_path)).gsub('?', '%3F')
113+
request(headers, body, [], 'X-Accel-Redirect') do |response|
112114
response.must_be :ok?
113115
response.body.must_be :empty?
114116
response.headers['content-length'].must_equal '0'
115-
response.headers['x-accel-redirect'].must_equal '/tmp/rack_sendfile'
117+
response.headers['x-accel-redirect'].must_equal expected
116118
end
117119
end
118120

0 commit comments

Comments
 (0)