@@ -43,15 +43,15 @@ func TestEcho(t *testing.T) {
4343
4444func TestEchoIndex (t * testing.T ) {
4545 e := New ()
46- e .Index ("recipes/website/public /index.html" )
46+ e .Index ("_fixture /index.html" )
4747 c , b := request (GET , "/" , e )
4848 assert .Equal (t , http .StatusOK , c )
4949 assert .NotEmpty (t , b )
5050}
5151
5252func TestEchoFavicon (t * testing.T ) {
5353 e := New ()
54- e .Favicon ("recipes/website/public /favicon.ico" )
54+ e .Favicon ("_fixture /favicon.ico" )
5555 c , b := request (GET , "/favicon.ico" , e )
5656 assert .Equal (t , http .StatusOK , c )
5757 assert .NotEmpty (t , b )
@@ -61,31 +61,32 @@ func TestEchoStatic(t *testing.T) {
6161 e := New ()
6262
6363 // OK
64- e .Static ("/scripts " , "recipes/website/public/scripts " )
65- c , b := request (GET , "/scripts/main.js " , e )
64+ e .Static ("/images " , "_fixture/images " )
65+ c , b := request (GET , "/images/walle.png " , e )
6666 assert .Equal (t , http .StatusOK , c )
6767 assert .NotEmpty (t , b )
6868
6969 // No file
70- e .Static ("/scripts " , "recipes/website/public /scripts" )
71- c , _ = request (GET , "/scripts/index.js " , e )
70+ e .Static ("/images " , "_fixture /scripts" )
71+ c , _ = request (GET , "/images/bolt.png " , e )
7272 assert .Equal (t , http .StatusNotFound , c )
7373
7474 // Directory
75- e .Static ("/scripts " , "recipes/website/public/scripts " )
76- c , _ = request (GET , "/scripts " , e )
75+ e .Static ("/images " , "_fixture/images " )
76+ c , _ = request (GET , "/images " , e )
7777 assert .Equal (t , http .StatusForbidden , c )
7878
7979 // Directory with index.html
80- e .Static ("/" , "recipes/website/public " )
80+ e .Static ("/" , "_fixture " )
8181 c , r := request (GET , "/" , e )
8282 assert .Equal (t , http .StatusOK , c )
8383 assert .Equal (t , true , strings .HasPrefix (r , "<!doctype html>" ))
8484
8585 // Sub-directory with index.html
8686 c , r = request (GET , "/folder" , e )
8787 assert .Equal (t , http .StatusOK , c )
88- assert .Equal (t , "sub directory" , r )
88+ assert .Equal (t , true , strings .HasPrefix (r , "<!doctype html>" ))
89+ // assert.Equal(t, "sub directory", r)
8990}
9091
9192func TestEchoMiddleware (t * testing.T ) {
0 commit comments