MCPcopy
hub / github.com/gotify/server / Test_GetApplications

Method Test_GetApplications

api/application_test.go:251–265  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

249}
250
251func (s *ApplicationSuite) Test_GetApplications() {
252 userBuilder := s.db.User(5)
253 first := userBuilder.NewAppWithToken(1, "perfper")
254 second := userBuilder.NewAppWithToken(2, "asdasd")
255
256 test.WithUser(s.ctx, 5)
257 s.ctx.Request = httptest.NewRequest("GET", "/tokens", nil)
258
259 s.a.GetApplications(s.ctx)
260
261 assert.Equal(s.T(), 200, s.recorder.Code)
262 first.Image = "static/defaultapp.png"
263 second.Image = "static/defaultapp.png"
264 test.BodyEquals(s.T(), []*model.Application{first, second}, s.recorder)
265}
266
267func (s *ApplicationSuite) Test_GetApplications_WithImage() {
268 userBuilder := s.db.User(5)

Callers

nothing calls this directly

Calls 5

WithUserFunction · 0.92
BodyEqualsFunction · 0.92
UserMethod · 0.80
NewAppWithTokenMethod · 0.80
GetApplicationsMethod · 0.80

Tested by

no test coverage detected