Ejemplo n.º 1
0
func (m *Mother) NotificationsFinder() services.NotificationsFinder {
	clientsRepo, kindsRepo := m.Repos()
	return services.NewNotificationsFinder(clientsRepo, kindsRepo)
}
	. "github.com/onsi/gomega"
)

var _ = Describe("NotificationsFinder", func() {
	var (
		finder      services.NotificationsFinder
		clientsRepo *mocks.ClientsRepository
		kindsRepo   *mocks.KindsRepo
		database    *mocks.Database
	)

	BeforeEach(func() {
		clientsRepo = mocks.NewClientsRepository()
		kindsRepo = mocks.NewKindsRepo()
		database = mocks.NewDatabase()
		finder = services.NewNotificationsFinder(clientsRepo, kindsRepo)
	})

	Describe("ClientAndKind", func() {
		BeforeEach(func() {
			clientsRepo.FindCall.Returns.Client = models.Client{
				ID: "some-client-id",
			}

			kindsRepo.FindCall.Returns.Kinds = []models.Kind{
				{
					ID:       "perimeter_breach",
					ClientID: "some-client-id",
				},
			}
		})