api_test.go 783 B

1234567891011121314151617181920212223242526272829303132333435
  1. package api
  2. import (
  3. "testing"
  4. )
  5. func TestHttpApi(t *testing.T) {
  6. // Convey("Given the grafana api", t, func() {
  7. // ConveyApiScenario("Can sign up", func(c apiTestContext) {
  8. // c.PostJson()
  9. // So(c.Resp, ShouldEqualJsonApiResponse, "User created and logged in")
  10. // })
  11. //
  12. // m := macaron.New()
  13. // m.Use(middleware.GetContextHandler())
  14. // m.Use(middleware.Sessioner(&session.Options{}))
  15. // Register(m)
  16. //
  17. // var context *middleware.Context
  18. // m.Get("/", func(c *middleware.Context) {
  19. // context = c
  20. // })
  21. //
  22. // resp := httptest.NewRecorder()
  23. // req, err := http.NewRequest("GET", "/", nil)
  24. // So(err, ShouldBeNil)
  25. //
  26. // m.ServeHTTP(resp, req)
  27. //
  28. // Convey("should red 200", func() {
  29. // So(resp.Code, ShouldEqual, 200)
  30. // })
  31. // })
  32. }