rethinkdb_test.go 611 B

1234567891011121314151617181920212223242526272829
  1. package stores
  2. import (
  3. "testing"
  4. . "github.com/smartystreets/goconvey/convey"
  5. "github.com/torkelo/grafana-pro/pkg/models"
  6. )
  7. func TestRethinkStore(t *testing.T) {
  8. Convey("Insert dashboard", t, func() {
  9. store := NewRethinkStore(&RethinkCfg{DatabaseName: "tests"})
  10. //defer r.DbDrop("tests").Exec(store.session)
  11. dashboard := models.NewDashboard("test")
  12. dashboard.AccountId = "123"
  13. err := store.SaveDashboard(dashboard)
  14. So(err, ShouldBeNil)
  15. So(dashboard.Id, ShouldNotBeEmpty)
  16. read, err := store.GetDashboardByTitle("test", "123")
  17. So(err, ShouldBeNil)
  18. So(read, ShouldNotBeNil)
  19. })
  20. }