fix mock and tests

This commit is contained in:
Pedro Nasser
2016-08-11 02:18:54 -03:00
parent 5e892034e7
commit 9472575303
3 changed files with 21 additions and 6 deletions

View File

@@ -8,15 +8,19 @@ import (
"net/http/httptest"
"testing"
"github.com/Sirupsen/logrus"
"golang.org/x/net/context"
"github.com/gin-gonic/gin"
"github.com/iron-io/functions/api/models"
titancommon "github.com/iron-io/titan/common"
)
func testRouter() *gin.Engine {
r := gin.Default()
ctx := context.Background()
r.Use(func(c *gin.Context) {
c.Set("log", logrus.WithFields(logrus.Fields{}))
ctx, _ := titancommon.LoggerWithFields(ctx, extractFields(c))
c.Set("ctx", ctx)
c.Next()
})
bindHandlers(r)