(t *testing.T)
| 58 | } |
| 59 | |
| 60 | func TestFileServerBasic(t *testing.T) { |
| 61 | urls := []resource{ |
| 62 | "/v1/static/css/main.css", |
| 63 | "/v1/static/js/main.js", |
| 64 | "/v1/static/favicon.ico", |
| 65 | "/v1/static/app2", |
| 66 | "/v1/static/app2/app2app3", |
| 67 | "/v1/static", |
| 68 | } |
| 69 | |
| 70 | app := newApp() |
| 71 | // route := app.GetRouteReadOnly("GET/{file:path}") |
| 72 | // if route == nil { |
| 73 | // app.Logger().Fatalf("expected a route to serve files") |
| 74 | // } |
| 75 | |
| 76 | // if expected, got := "./assets", route.StaticDir(); expected != got { |
| 77 | // app.Logger().Fatalf("expected route's static directory to be: '%s' but got: '%s'", expected, got) |
| 78 | // } |
| 79 | |
| 80 | // if !route.StaticDirContainsIndex() { |
| 81 | // app.Logger().Fatalf("epxected ./assets to contain an %s file", "/index.html") |
| 82 | // } |
| 83 | |
| 84 | e := httptest.New(t, app) |
| 85 | for _, u := range urls { |
| 86 | url := u.String() |
| 87 | contents := u.loadFromBase("./assets", "/v1/static") |
| 88 | |
| 89 | e.GET(url).Expect(). |
| 90 | Status(httptest.StatusOK). |
| 91 | ContentType(u.contentType(), app.ConfigurationReadOnly().GetCharset()). |
| 92 | Body().IsEqual(contents) |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | // Tests subdomain + request path and system directory with a name that contains a dot(.) |
| 97 | func TestHandleDirDot(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…