Phoenix how to integration test a file download

I have added basic file upload and download functionality to my site. Testing the upload in controller tests is trivial as I just pass a valid %Plug.Upload{} to the controller and validate that the controller does its job. However, how can I test that the correct file was downloaded to the client? To be clear, I use send_download for downloads.

What is the actual problem? You can simply digest it with md5 or sha1 and check if it matches the file you originally sent?

Thank you for replying @dimitarvp. Excuse me, because I am still a novice. I want to know which field in the conn stores the downloaded file to hash.

Have you run IO.inspect conn in your controller?

I have since I asked this question. Pardon me for waisting your time. I thought there is more ceremony involved in testing these things in Elixir.

So did you fix your problem?

Yes. It is the resp_body field.