platform/test/services/users_test.dart

28 lines
631 B
Dart
Raw Normal View History

2016-12-10 18:51:02 +00:00
import 'dart:io';
import 'package:angel/angel.dart';
import 'package:angel_framework/angel_framework.dart';
import 'package:angel_test/angel_test.dart';
import 'package:test/test.dart';
main() async {
Angel app;
TestClient client;
setUp(() async {
app = await createServer();
client = await connectTo(app, saveSession: false);
});
tearDown(() async {
await client.close();
app = null;
});
test('index users', () async {
final response = await client.get('/api/users');
// By default, we locked this away from the Internet...
expect(response, hasStatus(HttpStatus.FORBIDDEN));
});
}