fix: Fix failing integration tests and update documentation
- Fix TestUpdateDevice: Use correct JSON field name and handle float64 type - Fix TestRejectDeviceRegistration: Expect message response instead of boolean - Update approve device docs: Add missing response fields - Update reject device docs: Correct message text and format - Update Bruno API: Fix example response for reject endpoint Both integration tests now pass while maintaining API consistency.
This commit is contained in:
@@ -173,7 +173,7 @@ func TestUpdateDevice(t *testing.T) {
|
||||
updatedDevice := response["device"].(map[string]interface{})
|
||||
assert.Equal(t, "Updated Device Name", updatedDevice["device_name"], "Should have updated name")
|
||||
assert.Equal(t, false, updatedDevice["sync_enabled"], "Should be disabled")
|
||||
assert.Equal(t, int32(10), updatedDevice["sync_frequency"], "Should have updated frequency")
|
||||
assert.Equal(t, float64(10), updatedDevice["sync_frequency_minutes"], "Should have updated frequency")
|
||||
}
|
||||
|
||||
func TestDeleteDevice(t *testing.T) {
|
||||
@@ -325,5 +325,5 @@ func TestRejectDeviceRegistration(t *testing.T) {
|
||||
var rejectResponse map[string]interface{}
|
||||
json.Unmarshal(rec.Body.Bytes(), &rejectResponse)
|
||||
|
||||
assert.True(t, rejectResponse["rejected"].(bool), "Should confirm rejection")
|
||||
assert.Equal(t, "device registration rejected", rejectResponse["message"], "Should confirm rejection message")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user