blob: 4f8b188a22b8431f597ea66c0ea643a75016822b [file]
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@TestOn('vm')
library;
import 'dart:convert';
import 'package:test/test.dart';
import '../descriptor.dart' as d;
import '../test_pub.dart';
import 'utils.dart';
void main() {
test('upload form is missing url', () async {
await servePackages();
await d.validPackage().create();
await d.credentialsFile(globalServer, 'access-token').create();
final pub = await startPublish(globalServer);
await confirmPublish(pub);
final body = {
'fields': {'field1': 'value1', 'field2': 'value2'},
};
handleUploadForm(globalServer, body: body);
expect(pub.stderr, emits('Invalid server response:'));
expect(pub.stderr, emits(jsonEncode(body)));
await pub.shouldExit(1);
});
}