Skip to content

Commit

Permalink
change http url req
Browse files Browse the repository at this point in the history
  • Loading branch information
gouravmpk committed Feb 27, 2024
1 parent 99eea4a commit 87775ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions handlers/bounty_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ func TestGetBountyIndexById(t *testing.T) {

rctx := chi.NewRouteContext()
rctx.URLParams.Add("bountyId", strconv.Itoa(int(bounty.ID)))
req, err := http.NewRequestWithContext(context.WithValue(context.Background(), chi.RouteCtxKey, rctx), http.MethodGet, "/index/1", nil)
req, err := http.NewRequestWithContext(context.WithValue(context.Background(), chi.RouteCtxKey, rctx), http.MethodGet, "gobounties/index/1", nil)
assert.NoError(t, err)

mockDb.On("GetBountyIndexById", "1").Return(int64(12), nil).Once()
Expand All @@ -912,7 +912,7 @@ func TestGetBountyIndexById(t *testing.T) {
bountyID := ""
rctx := chi.NewRouteContext()
rctx.URLParams.Add("bountyId", bountyID)
req, err := http.NewRequestWithContext(context.WithValue(context.Background(), chi.RouteCtxKey, rctx), http.MethodGet, "/index/"+bountyID, nil)
req, err := http.NewRequestWithContext(context.WithValue(context.Background(), chi.RouteCtxKey, rctx), http.MethodGet, "gobounties/index/"+bountyID, nil)
assert.NoError(t, err)

mockDb.On("GetBountyIndexById", bountyID).Return(int64(0), fmt.Errorf("bounty not found")).Once()
Expand Down Expand Up @@ -1035,7 +1035,7 @@ func TestGetAllBounties(t *testing.T) {
}

rctx := chi.NewRouteContext()
req, _ := http.NewRequestWithContext(context.WithValue(context.Background(), chi.RouteCtxKey, rctx), http.MethodGet, "/all", nil)
req, _ := http.NewRequestWithContext(context.WithValue(context.Background(), chi.RouteCtxKey, rctx), http.MethodGet, "gobounties/all", nil)

mockDb.On("GetAllBounties", req).Return(bounties)
mockDb.On("GetPersonByPubkey", mock.Anything).Return(db.Person{}, nil)
Expand Down

0 comments on commit 87775ac

Please sign in to comment.