Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: third_party/pkg/angular/test/mock/http_backend_spec.dart

Issue 148453003: Updating Angular version (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/pkg/angular/test/mock/http_backend_spec.dart
diff --git a/third_party/pkg/angular/test/mock/http_backend_spec.dart b/third_party/pkg/angular/test/mock/http_backend_spec.dart
index e89e5c74c0523ada9e3ceecf3129b0c1bb2c91a0..65ff89b1941bcb09abca7ee02090016e374b6272 100644
--- a/third_party/pkg/angular/test/mock/http_backend_spec.dart
+++ b/third_party/pkg/angular/test/mock/http_backend_spec.dart
@@ -42,6 +42,23 @@ main() => describe('MockHttpBackend', () {
});
+ it('should respond with JSON', inject((Logger logger) {
+ hb.when('GET', '/url1').respond(200, ['abc'], {});
+ hb.when('GET', '/url2').respond(200, {'key': 'value'}, {});
+
+
+ callback.andCallFake((status, response) {
+ expect(status).toBe(200);
+ logger(response);
+ });
+
+ hb('GET', '/url1', null, callback);
+ hb('GET', '/url2', null, callback);
+ hb.flush();
+ expect(logger).toEqual(['["abc"]', '{"key":"value"}']);
+ }));
+
+
it('should throw error when unexpected request', () {
hb.when('GET', '/url1').respond(200, 'content');
expect(() {
« no previous file with comments | « third_party/pkg/angular/test/introspection_spec.dart ('k') | third_party/pkg/angular/test/tools/selector_spec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698