:)
This commit is contained in:
parent
e5e5e565df
commit
e97106d6ef
3 changed files with 7 additions and 6 deletions
|
@ -8,7 +8,7 @@ import 'package:uuid/uuid.dart';
|
|||
final Uuid _uuid = new Uuid();
|
||||
|
||||
Future<TestClient> connectTo(Angel app,
|
||||
{Map initialSession, bool saveSession: true}) async {
|
||||
{Map initialSession, bool saveSession: false}) async {
|
||||
TestClient client;
|
||||
var path = '/${_uuid.v1()}/${_uuid.v1()}/${_uuid.v1()}';
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ author: "Tobe O <thosakwe@gmail.com>"
|
|||
description: "Testing utility library for the Angel framework."
|
||||
homepage: "https://github.com/angel-dart/test.git"
|
||||
name: "angel_test"
|
||||
version: "1.0.0-dev"
|
||||
version: "1.0.0-dev+1"
|
||||
dependencies:
|
||||
angel_client: "^1.0.0-dev+16"
|
||||
angel_framework: "^1.0.0-dev"
|
||||
|
|
|
@ -35,19 +35,20 @@ main() {
|
|||
|
||||
group('session', () {
|
||||
test('initial session', () async {
|
||||
final TestClient client =
|
||||
await connectTo(app, initialSession: {'foo': 'bar'});
|
||||
final TestClient client = await connectTo(app,
|
||||
initialSession: {'foo': 'bar'}, saveSession: true);
|
||||
expect(client.session['foo'], equals('bar'));
|
||||
});
|
||||
|
||||
test('add to session', () async {
|
||||
final TestClient client = await connectTo(app);
|
||||
final TestClient client = await connectTo(app, saveSession: true);
|
||||
await client.addToSession({'michael': 'jackson'});
|
||||
expect(client.session['michael'], equals('jackson'));
|
||||
});
|
||||
|
||||
test('remove from session', () async {
|
||||
final TestClient client = await connectTo(app, initialSession: {'angel': 'framework'});
|
||||
final TestClient client = await connectTo(app,
|
||||
initialSession: {'angel': 'framework'}, saveSession: true);
|
||||
await client.removeFromSession(['angel']);
|
||||
expect(client.session.containsKey('angel'), isFalse);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue