MCPcopy Create free account
hub / github.com/GetStream/stream-go2 / TestUpdateActivities

Function TestUpdateActivities

feed_test.go:67–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

65}
66
67func TestUpdateActivities(t *testing.T) {
68 var (
69 client, requester = newClient(t)
70 ctx = context.Background()
71 now = getTime(time.Now())
72 bobActivity = stream.Activity{
73 Actor: "bob",
74 Verb: "like",
75 Object: "ice-cream",
76 ForeignID: "bob:123",
77 Time: now,
78 Extra: map[string]any{"influence": 42},
79 }
80 )
81 _, err := client.UpdateActivities(ctx, bobActivity)
82 require.NoError(t, err)
83
84 body := fmt.Sprintf(`{"activities":[{"actor":"bob","foreign_id":"bob:123","influence":42,"object":"ice-cream","time":%q,"verb":"like"}]}`, now.Format(stream.TimeLayout))
85 testRequest(t, requester.req, http.MethodPost, "https://api.stream-io-api.com/api/v1.0/activities/?api_key=key", body)
86}
87
88func TestFollow(t *testing.T) {
89 var (

Callers

nothing calls this directly

Calls 4

newClientFunction · 0.85
getTimeFunction · 0.85
testRequestFunction · 0.85
UpdateActivitiesMethod · 0.80

Tested by

no test coverage detected