Beispiel #1
0
	"errors"
	"net/http"

	"github.com/concourse/atc/auth"
	. "github.com/concourse/atc/auth/github"
	"github.com/concourse/atc/auth/github/fakes"
	"github.com/pivotal-golang/lager/lagertest"

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

var _ = Describe("TeamVerifier", func() {
	var (
		teams      []Team
		fakeClient *fakes.FakeClient

		verifier auth.Verifier
	)

	BeforeEach(func() {
		teams = []Team{
			{Name: "some-team", Organization: "some-org"},
			{Name: "some-team-two", Organization: "some-org"},
		}
		fakeClient = new(fakes.FakeClient)

		verifier = NewTeamVerifier(teams, fakeClient)
	})

	Describe("Verify", func() {
		var (
Beispiel #2
0
import (
	"errors"
	"net/http"

	. "github.com/concourse/atc/auth/github"
	"github.com/concourse/atc/auth/github/fakes"
	"github.com/pivotal-golang/lager/lagertest"

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

var _ = Describe("UserVerifier", func() {
	var (
		fakeClient *fakes.FakeClient

		verifier Verifier
	)

	BeforeEach(func() {
		fakeClient = new(fakes.FakeClient)

		verifier = NewUserVerifier([]string{"some-user", "some-other-user"}, fakeClient)
	})

	Describe("Verify", func() {
		var (
			httpClient *http.Client

			verified  bool
			verifyErr error
Beispiel #3
0
	"errors"
	"net/http"

	"github.com/concourse/atc/auth"
	. "github.com/concourse/atc/auth/github"
	"github.com/concourse/atc/auth/github/fakes"
	"github.com/pivotal-golang/lager/lagertest"

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

var _ = Describe("OrganizationVerifier", func() {
	var (
		organizations []string
		fakeClient    *fakes.FakeClient

		verifier auth.Verifier
	)

	BeforeEach(func() {
		organizations = []string{"some-organization", "another-organization"}
		fakeClient = new(fakes.FakeClient)

		verifier = NewOrganizationVerifier(organizations, fakeClient)
	})

	Describe("Verify", func() {
		var (
			httpClient *http.Client

			verified  bool