From 85bcf9439a2e109c153120e2d06668c94aad1a76 Mon Sep 17 00:00:00 2001 From: Uros Jovanovic Date: Mon, 12 Oct 2015 21:53:17 +0200 Subject: [PATCH] * tests for wily in router --- internal/router/router_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/internal/router/router_test.go b/internal/router/router_test.go index f88d17707..88eaa26a8 100644 --- a/internal/router/router_test.go +++ b/internal/router/router_test.go @@ -121,6 +121,19 @@ var routerGetTests = []struct { Method: "GET", CharmURL: "cs:win81/visualstudio-2012", }, +}, { + about: "wily id handler", + handlers: Handlers{ + Id: map[string]IdHandler{ + "foo": testIdHandler, + }, + }, + urlStr: "/wily/wordpress-34/foo", + expectStatus: http.StatusOK, + expectBody: idHandlerTestResp{ + Method: "GET", + CharmURL: "cs:wily/wordpress-34", + }, }, { about: "id handler with no series in id", handlers: Handlers{ @@ -200,6 +213,19 @@ var routerGetTests = []struct { Method: "GET", CharmURL: "cs:~joe/precise/wordpress-34", }, +}, { + about: "wily handler with user", + handlers: Handlers{ + Id: map[string]IdHandler{ + "foo": testIdHandler, + }, + }, + urlStr: "/~joe/wily/wordpress-34/foo", + expectStatus: http.StatusOK, + expectBody: idHandlerTestResp{ + Method: "GET", + CharmURL: "cs:~joe/wily/wordpress-34", + }, }, { about: "id handler with user and extra path", handlers: Handlers{