-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test failing while comparing apiary doc with a real service body for no visible reason #90
Comments
I suspect that it can be caused by trailing newline character in the expected or real response which should not be noticeable. |
@netmilk I have already checked that newline or extra space scenario, unfortunately that is not the problem. |
@sameergarg Would you mind providing the related part from |
When you try it to parse it with |
Hi Sorry it was my mistake to add apostrophe in the version of documentation i passed. I was trying few things and i forgot to remove apostrophe. |
@sameergarg, did you manage to figure out why it was failing? Can you provide me the backend code to test it and investigate on my own? |
I'm having a similar issue:
The only thing that differ looks to be the I've checked withe spaces and Apiary is not about syntax errors.. |
Just out of curiosity, could it possibly be that expected header is |
@w-vi I'm not sure, I think I don't have the ability to change it as the definition is:
anyway that is not giving errors in other tests, only in this one... |
Thanks @webnard, passed through drafter and seems to be fine, I'll keep investigating and will report something in case of success... |
@webnard is right that plain text hello world might be a problem due to extraneous newline (known bug), but your payloads are JSON. I'll try to get to this and reproduce the behavior. If you happen to find more info meanwhile, please share it here. Thanks! |
I'm having very similar issues as well as GET requests not being tested at all. |
Any updates on this? Do you experience the same problems with the latest version of Dredd? |
I didn't hear back, so it seems it went away with later versions of Dredd. Thanks everyone for investigating! 👍 If this is still relevant, feel free to get back and re-open or file a new issue. |
redd apiary.apib http://localhost:9000 -d -e
info: Beginning Dredd testing...
fail: GET /greetings duration: 2681ms
fail: body: Real and expected data does not match.
request:
body:
headers:
User-Agent: Dredd/0.3.9 (Darwin 13.3.0; x64)
uri: /greetings
method: GET
expected:
headers:
content-type: text/plain; charset=utf-8
body:
hello
statusCode: 200
actual:
statusCode: 200
headers:
content-type: text/plain; charset=utf-8
content-length: 5
body:
hello
complete: 0 passing, 1 failing, 0 errors, 0 skipped
complete: Tests took 2705ms
The text was updated successfully, but these errors were encountered: