Skip to content

Commit

Permalink
Fix two issues with List tests
Browse files Browse the repository at this point in the history
* Ensure that `subscription_item` is not sent as a parameter when listing
usage record summaries
* Update the test for usage record summary
* Fix the bank account list test for Accounts to pass the right parameter
  • Loading branch information
remi-stripe committed Aug 28, 2018
1 parent bcbb8de commit fe69df4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bankaccount/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestBankAccountGet_ByCustomer(t *testing.T) {
}

func TestBankAccountList_ByAccount(t *testing.T) {
i := List(&stripe.BankAccountListParams{Customer: stripe.String("acct_123")})
i := List(&stripe.BankAccountListParams{Account: stripe.String("acct_123")})

// Verify that we can get at least one bank account
assert.True(t, i.Next())
Expand Down
2 changes: 1 addition & 1 deletion usagerecordsummary.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type UsageRecordSummary struct {
// UsageRecordSummaryListParams is the set of parameters that can be used when listing charges.
type UsageRecordSummaryListParams struct {
ListParams `form:"*"`
SubscriptionItem *string `form:"subscription_item"`
SubscriptionItem *string `form:"-"` // Sent in with the URL
}

// UsageRecordSummaryList is a list of usage record summaries as retrieved from a list endpoint.
Expand Down
2 changes: 1 addition & 1 deletion usagerecordsummary/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
_ "github.com/stripe/stripe-go/testing"
)

func TestUsageRecordList(t *testing.T) {
func TestUsageRecordSummaryList(t *testing.T) {
params := &stripe.UsageRecordSummaryListParams{
SubscriptionItem: stripe.String("si_123"),
}
Expand Down

0 comments on commit fe69df4

Please sign in to comment.