Index: pkg/shelf/test/response_test.dart |
diff --git a/pkg/shelf/test/response_test.dart b/pkg/shelf/test/response_test.dart |
index 9ee47c5f93360f8a62b82680a7bdd597ff12be3e..e1e3ae6f1078ef5b4b770da717f7847e5f0b263f 100644 |
--- a/pkg/shelf/test/response_test.dart |
+++ b/pkg/shelf/test/response_test.dart |
@@ -157,4 +157,54 @@ void main() { |
}).lastModified, equals(DateTime.parse("1994-11-06 08:49:37z"))); |
}); |
}); |
+ |
+ group("context", () { |
+ test("are correctly populated in ok", () { |
+ expect(new Response.ok("okay!", headers: {}, context: { |
+ 'my-param' : 42 |
+ }).context['my-param'], equals(42)); |
+ }); |
+ |
+ test("is correctly populated in forbidden", () { |
+ expect(new Response.forbidden("okay!", headers: {}, context: { |
+ 'my-param' : 42 |
+ }).context['my-param'], equals(42)); |
+ }); |
+ |
+ test("is correctly populated in found", () { |
+ expect(new Response.found("okay!", headers: {}, context: { |
+ 'my-param' : 42 |
+ }).context['my-param'], equals(42)); |
+ }); |
+ |
+ test("is correctly populated in internalServerError", () { |
+ expect(new Response.internalServerError(headers: {}, context: { |
+ 'my-param' : 42 |
+ }).context['my-param'], equals(42)); |
+ }); |
+ |
+ test("is correctly populated in movedPermanently", () { |
+ expect(new Response.movedPermanently("okay!", headers: {}, context: { |
+ 'my-param' : 42 |
+ }).context['my-param'], equals(42)); |
+ }); |
+ |
+ test("is correctly populated in notFound", () { |
+ expect(new Response.notFound("okay!", headers: {}, context: { |
+ 'my-param' : 42 |
+ }).context['my-param'], equals(42)); |
+ }); |
+ |
+ test("is correctly populated in notModified", () { |
+ expect(new Response.notModified(headers: {}, context: { |
+ 'my-param' : 42 |
+ }).context['my-param'], equals(42)); |
+ }); |
+ |
+ test("is correctly populated in seeOther", () { |
+ expect(new Response.seeOther("other", headers: {}, context: { |
+ 'my-param' : 42 |
+ }).context['my-param'], equals(42)); |
+ }); |
+ }); |
} |