github.com/cheikhshift/buffalo@v0.9.5/binding/binding_test.go (about) 1 package binding 2 3 import ( 4 "testing" 5 "time" 6 7 "github.com/stretchr/testify/require" 8 ) 9 10 func TestParseTimeErrorParsing(t *testing.T) { 11 r := require.New(t) 12 _, err := parseTime([]string{"this is sparta"}) 13 r.Error(err) 14 } 15 16 func TestParseTime(t *testing.T) { 17 r := require.New(t) 18 tt, err := parseTime([]string{"2017-01-01"}) 19 r.NoError(err) 20 expected := time.Date(2017, time.January, 1, 0, 0, 0, 0, time.UTC) 21 r.Equal(expected, tt) 22 }