2019-12-07 23:40:42 +07:00
|
|
|
package handlers
|
|
|
|
|
|
|
|
import (
|
2019-12-24 09:14:52 +07:00
|
|
|
"github.com/authelia/authelia/internal/mocks"
|
2019-12-07 23:40:42 +07:00
|
|
|
"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)
|
|
|
|
}
|