Closed lpil closed 6 years ago
Don't need a helper function.
import Raxx
response = request(:GET, "/")
|> set_header("accept", "application/json")
|> MyApp.handle_request(config)
assert response.status == 200
assert response.body == "Hello, World!"
That's what I do in simple cases.
If I am testing streaming I normally start a server for every test and use HTTPoison (or :gen_tcp). https://github.com/CrowdHailer/Ace/blob/master/test/ace/http1/server_test.exs#L4-L15
You are right a pointer in the README would probably be benificial
Fab, I didn't spot the request function :)
@lpil Any more questions on this issue?
Did you get it working? If you want to start a Testing section PR that be great, even if it has some missing bits or questions. I should be able to contribute more next week
I'm happy, though I've not got round to doing any testing myself. May end up using Phoenix/Plug/Cowboy for the websockets pubsub.
Unfortunately if websockets are required then that is probably the right solution. I think websockets don't have a home once you are mostly running on HTTP/2 but that is not the reality at the moment.
Will close this for now
Yee, HTTP2 sounds like a good solution, we're just not quite there yet.
Thanks again :)
Hey!
Could you document the recommended approach of testing raxx apps please? Are there some handy helper functions we can use? :)
Cheers, Louis