(t *testing.T)
| 34 | } |
| 35 | |
| 36 | func TestAddActivity(t *testing.T) { |
| 37 | var ( |
| 38 | client, requester = newClient(t) |
| 39 | ctx = context.Background() |
| 40 | flat, _ = newFlatFeedWithUserID(client, "123") |
| 41 | bobActivity = stream.Activity{Actor: "bob", Verb: "like", Object: "ice-cream", To: []string{"flat:456"}} |
| 42 | ) |
| 43 | _, err := flat.AddActivity(ctx, bobActivity) |
| 44 | require.NoError(t, err) |
| 45 | body := `{"actor":"bob","object":"ice-cream","to":["flat:456"],"verb":"like"}` |
| 46 | testRequest(t, requester.req, http.MethodPost, "https://api.stream-io-api.com/api/v1.0/feed/flat/123/?api_key=key", body) |
| 47 | |
| 48 | requester.resp = `{"duration": "1ms"}` |
| 49 | _, err = flat.AddActivity(ctx, bobActivity) |
| 50 | require.NoError(t, err) |
| 51 | } |
| 52 | |
| 53 | func TestAddActivities(t *testing.T) { |
| 54 | var ( |
nothing calls this directly
no test coverage detected