Add BrowserClient for spec support
We have ApiClient which helps you to test ApiAction specs, but now we need a BrowserClient for testing browser based actions when you're not using Flow.
There are a few catches with this that we need to take in to consideration:
- How do we handle sessions?
- How do we handle cookies?
- How do we handle doing a POST where the Content-Type might change from
text/htmltoapplication/x-www-form-urlencodedor evenmultipart/form-data?
@jwoertink maybe we could add a super simple BrowserClient that just do the requests... like rails does using get, post test helpers
then we can improve in the future with sessions/cookies/content-type, at least we can have an action tester, does it makes sense?
ps: I just realized after writing my comment, is your BrowserClient expected to make http calls to a running lucky server? or to run the actions actions just on the crystal side?
When you run your specs, it will run a test server, so the ApiClient.post() or in this case BrowserClient.post() would actually send to the running server.
A simple one would be good to at least have a start.