Unexcepted failed Gavel/Dredd test

176 Views Asked by At

Can anyone help me figure out why this Dredd test fails? It looks fine to me:

fail: GET /device/2/battery duration: 260ms
fail: body: Real and expected data does not match.

request: 
body: 

headers: 
    User-Agent: Dredd/0.6.0 (Darwin 14.3.0; x64)

uri: /device/2/battery
method: GET


expected: 
headers: 
    connection: Keep-Alive
    content-length: 18
    content-type: text/plain

body: 
BATTERY REQ QUEUED

statusCode: 200


actual: 
statusCode: 200
headers: 
    connection: Keep-Alive
    content-length: 18
    content-type: text/plain
    date: Tue, 09 Jun 2015 19:01:59 GMT

body: 
BATTERY REQ QUEUED
1

There are 1 best solutions below

1
On BEST ANSWER

These suspicious errors are commonly caused by trailing newline character in expected or real body. Try to parse your blueprint with the CLI API Blueprint parser and see what Dredd expects exactly.

There is a hint for a workaround for this in the documentation.