github.com/justinjmoses/evergreen@v0.0.0-20170530173719-1d50e381ff0d/auth/naive_test.go (about)

     1  package auth
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/evergreen-ci/evergreen"
     7  	. "github.com/smartystreets/goconvey/convey"
     8  )
     9  
    10  func TestNaiveAuthManager(t *testing.T) {
    11  	Convey("When creating a UserManager with a Naive authentication", t, func() {
    12  		n := evergreen.NaiveAuthConfig{
    13  			Users: nil,
    14  		}
    15  		authConfig := evergreen.AuthConfig{
    16  			Crowd:  nil,
    17  			Naive:  &n,
    18  			Github: nil,
    19  		}
    20  		userManager, err := LoadUserManager(authConfig)
    21  		So(err, ShouldBeNil)
    22  		Convey("user manager should have nil functions for Login and LoginCallback handlers", func() {
    23  			So(userManager.GetLoginHandler(""), ShouldBeNil)
    24  			So(userManager.GetLoginCallbackHandler(), ShouldBeNil)
    25  		})
    26  	})
    27  }