authelia/internal/handlers/handler_configuration_test.go
Amir Zarrinkafsh fabb76754e
Rename org from clems4ever to authelia
Also fix references from config.yml to configuration.yml
2019-12-24 13:14:52 +11:00

33 lines
665 B
Go

package handlers
import (
"github.com/authelia/authelia/internal/mocks"
"github.com/stretchr/testify/suite"
)
type ConfigurationSuite struct {
suite.Suite
mock *mocks.MockAutheliaCtx
}
func (s *ConfigurationSuite) SetupTest() {
s.mock = mocks.NewMockAutheliaCtx(s.T())
}
func (s *ConfigurationSuite) TearDownTest() {
s.mock.Close()
}
func (s *ConfigurationSuite) TestShouldReturnConfiguredGATrackingID() {
GATrackingID := "ABC"
s.mock.Ctx.Configuration.GoogleAnalyticsTrackingID = GATrackingID
expectedBody := ConfigurationBody{
GoogleAnalyticsTrackingID: GATrackingID,
}
ConfigurationGet(s.mock.Ctx)
s.mock.Assert200OK(s.T(), expectedBody)
}