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

Method Test_GetApplications_WithImage

api/application_test.go:267–283  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

265}
266
267func (s *ApplicationSuite) Test_GetApplications_WithImage() {
268 userBuilder := s.db.User(5)
269 first := userBuilder.NewAppWithToken(1, "perfper")
270 second := userBuilder.NewAppWithToken(2, "asdasd")
271 first.Image = "abcd.jpg"
272 s.db.UpdateApplication(first)
273
274 test.WithUser(s.ctx, 5)
275 s.ctx.Request = httptest.NewRequest("GET", "/tokens", nil)
276
277 s.a.GetApplications(s.ctx)
278
279 assert.Equal(s.T(), 200, s.recorder.Code)
280 first.Image = "image/abcd.jpg"
281 second.Image = "static/defaultapp.png"
282 test.BodyEquals(s.T(), []*model.Application{first, second}, s.recorder)
283}
284
285func (s *ApplicationSuite) Test_DeleteApplication_internal_expectBadRequest() {
286 s.db.User(5).InternalApp(10)

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected