Example #1
0
	"github.com/cloudfoundry-incubator/notifications/testing/mocks"
	"github.com/cloudfoundry-incubator/notifications/v1/models"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("KindsRepo", func() {
	var (
		repo models.KindsRepo
		conn *db.Connection
	)

	BeforeEach(func() {

		repo = models.NewKindsRepo()
		database := db.NewDatabase(sqlDB, db.Config{})
		helpers.TruncateTables(database)
		conn = database.Connection().(*db.Connection)
	})

	Describe("Update", func() {
		Context("when the template id is meant to be set", func() {
			It("updates the record in the database", func() {
				kind := models.Kind{
					ID:         "my-kind",
					ClientID:   "my-client",
					TemplateID: "my-template",
				}

				kind, err := repo.Upsert(conn, kind)
Example #2
0
func (m *Mother) KindsRepo() v1models.KindsRepo {
	return v1models.NewKindsRepo()
}