Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach authored Jun 23, 2023
1 parent c06a9d5 commit 495821f
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions test/req/steps_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ defmodule Req.StepsTest do
end)

response = Req.get!(c.url)

assert content_length(response) == byte_size(body)
[content_length] = Req.Response.get_header(response, "content-length")
assert String.to_integer(content_length) == byte_size(body)
end

@tag :tmp_dir
Expand Down Expand Up @@ -1385,12 +1385,4 @@ defmodule Req.StepsTest do

Plug.Conn.send_resp(conn, status, Jason.encode_to_iodata!(data))
end

defp content_length(response) do
{"content-length", content_length_str} = List.keyfind!(response.headers, "content-length", 0)

{content_length, _remainder} = Integer.parse(content_length_str)

content_length
end
end

0 comments on commit 495821f

Please sign in to comment.