Skip to content

Commit

Permalink
Add customer field to order model (bold-commerce#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlebech committed May 30, 2016
1 parent b594307 commit adf1b84
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions order.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type Order struct {
UpdatedAt *time.Time `json:"updated_at"`
ClosedAt *time.Time `json:"closed_at"`
ProcessedAt *time.Time `json:"processed_at"`
Customer *Customer `json:"customer"`
BillingAddress *Address `json:"billing_address"`
ShippingAddress *Address `json:"shipping_address"`
Currency string `json:"currency"`
Expand Down
8 changes: 8 additions & 0 deletions order_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ func orderTests(t *testing.T, order Order) {
if order.TotalTax != nil {
t.Errorf("Order.TotalTax returned %+v, expected %+v", order.TotalTax, nil)
}

// Check customer
if order.Customer == nil {
t.Error("Expected Customer to not be nil")
}
if order.Customer.Email != "[email protected]" {
t.Errorf("Customer.Email, expected %v, actual %v", "[email protected]", order.Customer.Email)
}
}

func TestOrderList(t *testing.T) {
Expand Down

0 comments on commit adf1b84

Please sign in to comment.