Closed jwoertink closed 1 year ago
If you have an action that sets a custom header, then you want to test that the header is returned, the ApiClient doesn't seem to have those.
ApiClient
I'm not totally sure, but maybe because it rebuilds a new response object?
https://github.com/luckyframework/lucky/blob/22fcb187c2045a36823a03310d1ed68aec5d8f0b/src/lucky/base_http_client.cr#L149
class SomeAction < ApiAction get "/foo" do response.headers["X-TEST"] = "test" json({response: "ok"}) end end client = ApiClient.new response = client.exec(SomeAction) response.headers["X-TEST"] # does not exist
ugh... ok, this was just my bad. Something I was doing in my app...
If you have an action that sets a custom header, then you want to test that the header is returned, the
ApiClient
doesn't seem to have those.I'm not totally sure, but maybe because it rebuilds a new response object?
https://github.com/luckyframework/lucky/blob/22fcb187c2045a36823a03310d1ed68aec5d8f0b/src/lucky/base_http_client.cr#L149