@@ -58,7 +58,7 @@ func TestRead(t *testing.T) {
58
58
59
59
var validate toValidate
60
60
require .True (t , httpapi .Read (rw , r , & validate ))
61
- require .Equal (t , validate . Value , "hi" )
61
+ require .Equal (t , "hi" , validate . Value )
62
62
})
63
63
64
64
t .Run ("ValidateFailure" , func (t * testing.T ) {
@@ -75,8 +75,8 @@ func TestRead(t *testing.T) {
75
75
err := json .NewDecoder (rw .Body ).Decode (& v )
76
76
require .NoError (t , err )
77
77
require .Len (t , v .Errors , 1 )
78
- require .Equal (t , v .Errors [0 ].Field , "value" )
79
- require .Equal (t , v .Errors [0 ].Detail , "required" )
78
+ require .Equal (t , "value" , v .Errors [0 ].Field )
79
+ require .Equal (t , "Validation failed for tag \" required \" with value: \" \" " , v .Errors [0 ].Detail )
80
80
})
81
81
}
82
82
@@ -140,7 +140,7 @@ func TestReadUsername(t *testing.T) {
140
140
r := httptest .NewRequest ("POST" , "/" , bytes .NewBuffer (data ))
141
141
142
142
var validate toValidate
143
- require .Equal (t , httpapi .Read (rw , r , & validate ), testCase . Valid )
143
+ require .Equal (t , testCase . Valid , httpapi .Read (rw , r , & validate ))
144
144
})
145
145
}
146
146
}
0 commit comments