GetAllConfigs returns all created userconfig.
(t *testing.T)
| 160 | |
| 161 | // GetAllConfigs returns all created userconfig. |
| 162 | func Test_GetAllConfigs(t *testing.T) { |
| 163 | setup(t) |
| 164 | defer cleanup(t) |
| 165 | |
| 166 | userID := makeUserID() |
| 167 | config := makeConfig() |
| 168 | |
| 169 | for _, c := range allClients { |
| 170 | view := c.post(t, userID, config) |
| 171 | w := request(t, "GET", c.PrivateEndpoint, nil) |
| 172 | assert.Equal(t, http.StatusOK, w.Code) |
| 173 | var found ConfigsView |
| 174 | err := json.Unmarshal(w.Body.Bytes(), &found) |
| 175 | assert.NoError(t, err, "Could not unmarshal JSON") |
| 176 | assert.Equal(t, ConfigsView{Configs: map[string]userconfig.View{ |
| 177 | userID: view, |
| 178 | }}, found) |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | // GetAllConfigs returns the *newest* versions of all created userconfig. |
| 183 | func Test_GetAllConfigs_Newest(t *testing.T) { |
nothing calls this directly
no test coverage detected