diff options
| author | Amir Zarrinkafsh <nightah@me.com> | 2020-06-21 23:40:37 +1000 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-21 15:40:37 +0200 | 
| commit | 29e54c231ba16f4e597cd8699a249d2267a3245f (patch) | |
| tree | ec5c8ab132101d44ecb3053f2d58a485fdd54bdc /internal/handlers/handler_user_info_test.go | |
| parent | ddfce52939b17c9ef8e17bce7f834a56952dd4f4 (diff) | |
[MISC] Template global config and refactor some /api endpoints (#1135)
* [MISC] Template global config and refactor some /api endpoints
* /api/configuration has been removed in favour of templating said global config
* /api/configuration/extended has been renamed to /api/configuration and display_name has been removed
* /api/user/info has been modified to include display_name
Co-authored-by: Clement Michaud <clement.michaud34@gmail.com>
Diffstat (limited to 'internal/handlers/handler_user_info_test.go')
| -rw-r--r-- | internal/handlers/handler_user_info_test.go | 8 | 
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/handlers/handler_user_info_test.go b/internal/handlers/handler_user_info_test.go index 4d925787c..44702ec28 100644 --- a/internal/handlers/handler_user_info_test.go +++ b/internal/handlers/handler_user_info_test.go @@ -31,7 +31,7 @@ func (s *FetchSuite) TearDownTest() {  	s.mock.Close()  } -func setPreferencesExpectations(preferences UserPreferences, provider *storage.MockProvider) { +func setPreferencesExpectations(preferences UserInfo, provider *storage.MockProvider) {  	provider.  		EXPECT().  		LoadPreferred2FAMethod(gomock.Eq("john")). @@ -65,7 +65,7 @@ func setPreferencesExpectations(preferences UserPreferences, provider *storage.M  }  func TestMethodSetToU2F(t *testing.T) { -	table := []UserPreferences{ +	table := []UserInfo{  		{  			Method: "totp",  		}, @@ -97,7 +97,7 @@ func TestMethodSetToU2F(t *testing.T) {  		setPreferencesExpectations(expectedPreferences, mock.StorageProviderMock)  		UserInfoGet(mock.Ctx) -		actualPreferences := UserPreferences{} +		actualPreferences := UserInfo{}  		mock.GetResponseData(t, &actualPreferences)  		t.Run("expected method", func(t *testing.T) { @@ -132,7 +132,7 @@ func (s *FetchSuite) TestShouldGetDefaultPreferenceIfNotInDB() {  		Return("", storage.ErrNoTOTPSecret)  	UserInfoGet(s.mock.Ctx) -	s.mock.Assert200OK(s.T(), UserPreferences{Method: "totp"}) +	s.mock.Assert200OK(s.T(), UserInfo{Method: "totp"})  }  func (s *FetchSuite) TestShouldReturnError500WhenStorageFailsToLoad() {  | 
