Query string in conn for testing

I have an endpoint in which user can download a file in a csv format if the query params are passed in the conn.

         query_string == "format=csv"

Other wise it will return just json data. I tested it with postman and its working fine . Now i want to write a test case for it.
So What should be the possible approaches for that?
I don’t think we can place query string inside the conn.query_string key inside tests.
Query string is part of the url.
So how to test this behaviour?
Any help will be much appreciated

Thanks

:wave:

You can construct your request to include the query string …

conn = get(conn, "/some/path?format=csv")
1 Like

I recommend you have a look at some blogs/tutorials aimed specifically at testing endpoints with Phoenix:

To give you a more precise solution we would need more details.

3 Likes

Thanks.