()
| 330 | } |
| 331 | |
| 332 | func (s *PluginSuite) Test_GetDisplay_incorrectUser_expectNotFound() { |
| 333 | conf, err := s.db.GetPluginConfByUserAndPath(1, mock.ModulePath) |
| 334 | assert.NoError(s.T(), err) |
| 335 | inst, err := s.manager.Instance(conf.ID) |
| 336 | assert.Nil(s.T(), err) |
| 337 | mockInst := inst.(*mock.PluginInstance) |
| 338 | |
| 339 | mockInst.DisplayString = "test string" |
| 340 | |
| 341 | { |
| 342 | test.WithUser(s.ctx, 2) |
| 343 | |
| 344 | s.ctx.Request = httptest.NewRequest("GET", fmt.Sprintf("/plugin/%d/display", conf.ID), nil) |
| 345 | s.ctx.Params = gin.Params{{Key: "id", Value: fmt.Sprint(conf.ID)}} |
| 346 | s.a.GetDisplay(s.ctx) |
| 347 | |
| 348 | assert.Equal(s.T(), 404, s.recorder.Code) |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | func (s *PluginSuite) Test_GetDisplay_danglingConf_expectNotFound() { |
| 353 | conf := s.getDanglingConf(1) |
nothing calls this directly
no test coverage detected