(t *testing.T)
| 558 | } |
| 559 | |
| 560 | func TestRepositoriesService_Subscribe(t *testing.T) { |
| 561 | t.Parallel() |
| 562 | client, mux, _ := setup(t) |
| 563 | |
| 564 | mux.HandleFunc("/hub", func(_ http.ResponseWriter, r *http.Request) { |
| 565 | testMethod(t, r, "POST") |
| 566 | testHeader(t, r, "Content-Type", "application/x-www-form-urlencoded") |
| 567 | testFormValues(t, r, values{ |
| 568 | "hub.mode": "subscribe", |
| 569 | "hub.topic": "https://github.com/o/r/events/push", |
| 570 | "hub.callback": "http://localhost:8080/callback", |
| 571 | "hub.secret": "test secret", |
| 572 | }) |
| 573 | }) |
| 574 | |
| 575 | ctx := t.Context() |
| 576 | _, err := client.Repositories.Subscribe( |
| 577 | ctx, |
| 578 | "o", |
| 579 | "r", |
| 580 | "push", |
| 581 | "http://localhost:8080/callback", |
| 582 | []byte("test secret"), |
| 583 | ) |
| 584 | if err != nil { |
| 585 | t.Errorf("Repositories.Subscribe returned error: %v", err) |
| 586 | } |
| 587 | |
| 588 | testNewRequestAndDoFailure(t, "Subscribe", client, func() (*Response, error) { |
| 589 | return client.Repositories.Subscribe(ctx, "o", "r", "push", "http://localhost:8080", nil) |
| 590 | }) |
| 591 | } |
| 592 | |
| 593 | func TestRepositoriesService_Unsubscribe(t *testing.T) { |
| 594 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…