Merge pull request #246 from PatOConnor43/fix-test
Bind the decoder to req.body
This commit is contained in:
commit
264dd4dc91
2 changed files with 2 additions and 2 deletions
|
@ -113,7 +113,7 @@ main() {
|
|||
}, optional: ['bar']));
|
||||
var rq = MockHttpRequest('GET', Uri(path: 'foo'));
|
||||
await AngelHttp(app).handleRequest(rq);
|
||||
var body = await rq.response.transform(utf8.decoder).join();
|
||||
var body = await utf8.decoder.bind(rq.response).join();
|
||||
expect(json.decode(body), 2);
|
||||
});
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ main() {
|
|||
app.container.registerSingleton(Todo(text: TEXT, over: OVER));
|
||||
app.container.registerFactory<Future<Foo>>((container) async {
|
||||
var req = container.make<RequestContext>();
|
||||
var text = await req.body.transform(utf8.decoder).join();
|
||||
var text = await utf8.decoder.bind(req.body).join();
|
||||
return Foo(text);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue