(t *testing.T)
| 440 | } |
| 441 | |
| 442 | func TestGetUser_DataAttributes(t *testing.T) { |
| 443 | mux := http.NewServeMux() |
| 444 | mux.HandleFunc("/1/user", func(w http.ResponseWriter, r *http.Request) { |
| 445 | _, err := w.Write( |
| 446 | []byte( |
| 447 | `{"data":{"attributes":{"has_payment_method": false, "current_plan": "build"}}}`, |
| 448 | ), |
| 449 | ) |
| 450 | require.NoError(t, err) |
| 451 | }) |
| 452 | |
| 453 | ts, client := newTestClient(mux) |
| 454 | defer ts.Close() |
| 455 | |
| 456 | user, err := client.GetUser("test-token") |
| 457 | require.NoError(t, err) |
| 458 | assert.False(t, user.HasPaymentMethod) |
| 459 | } |
| 460 | |
| 461 | func TestChangeApplicationPlan_Success(t *testing.T) { |
| 462 | mux := http.NewServeMux() |
nothing calls this directly
no test coverage detected