Skip to content

Commit

Permalink
Allow small delta of time for timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
brycekahle committed Jul 13, 2017
1 parent e530c54 commit 93d4244
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/order_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http/httptest"
"strings"
"testing"
"time"

"github.com/guregu/kami"
"github.com/jinzhu/gorm"
Expand Down Expand Up @@ -746,8 +747,8 @@ func validateOrder(t *testing.T, expected, actual *models.Order) {
assert.Equal(expected.State, actual.State)
assert.Equal(expected.ShippingAddressID, actual.ShippingAddressID)
assert.Equal(expected.BillingAddressID, actual.BillingAddressID)
assert.Equal(expected.CreatedAt.Unix(), actual.CreatedAt.Unix())
assert.Equal(expected.UpdatedAt.Unix(), actual.UpdatedAt.Unix())
assert.WithinDuration(expected.CreatedAt, actual.CreatedAt, time.Duration(1)*time.Second)
assert.WithinDuration(expected.UpdatedAt, actual.UpdatedAt, time.Duration(1)*time.Second)
assert.Equal(expected.VATNumber, actual.VATNumber)

// we don't return the actual user
Expand Down

0 comments on commit 93d4244

Please sign in to comment.