diff --git a/README.md b/README.md index 046205e9..0f8cd15b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # angel_client -[![pub 1.0.0-dev+19](https://img.shields.io/badge/pub-1.0.0--dev+19-red.svg)](https://pub.dartlang.org/packages/angel_client) +[![pub 1.0.0-dev+20](https://img.shields.io/badge/pub-1.0.0--dev+20-red.svg)](https://pub.dartlang.org/packages/angel_client) ![build status](https://travis-ci.org/angel-dart/client.svg) Client library for the Angel framework. diff --git a/lib/base_angel_client.dart b/lib/base_angel_client.dart index a6a105b4..2b2426f2 100644 --- a/lib/base_angel_client.dart +++ b/lib/base_angel_client.dart @@ -136,7 +136,7 @@ abstract class BaseAngelClient extends Angel { String _join(url) { final head = basePath.replaceAll(new RegExp(r'/+$'), ''); - final tail = basePath.replaceAll(straySlashes, ''); + final tail = url.replaceAll(straySlashes, ''); return '$head/$tail'; } diff --git a/pubspec.yaml b/pubspec.yaml index ba0db73f..ef29353c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_client -version: 1.0.0-dev+19 +version: 1.0.0-dev+20 description: Client library for the Angel framework. author: Tobe O homepage: https://github.com/angel-dart/angel_client diff --git a/test/io_test.dart b/test/io_test.dart index a54fd802..4de6c9fc 100644 --- a/test/io_test.dart +++ b/test/io_test.dart @@ -30,9 +30,15 @@ main() { await httpServer.close(force: true); }); + test('plain requests', () async { + final response = await clientApp.get('/foo'); + print(response.body); + }); + test("index", () async { Postcard niagaraFalls = await serverPostcards.create( new Postcard(location: "Niagara Falls", message: "Missing you!")); + print('Niagra Falls: ${niagaraFalls.toJson()}'); List indexed = await clientPostcards.index(); print(indexed); diff --git a/test/shared.dart b/test/shared.dart index d9d9a551..4a5e11a0 100644 --- a/test/shared.dart +++ b/test/shared.dart @@ -9,12 +9,14 @@ class Postcard extends MemoryModel { @override bool operator ==(other) { - if (!(other is Postcard)) - return false; + if (!(other is Postcard)) return false; - return id == other.id && location == other.location && + return id == other.id && + location == other.location && message == other.message; } - -} \ No newline at end of file + Map toJson() { + return {'id': id, 'location': location, 'message': message}; + } +}