-
Notifications
You must be signed in to change notification settings - Fork 29
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
Unable to have a double receive any non-text body #19
Comments
This looks like a missing feature - binary content that is. The error you see looks like an active record error due to the fact that it is trying to store binary data into the text field. We could change rest-assured to store everything as binary and convert it to text on the way in/out for textual |
Thanks for the answer and clarity. Is that an avenue you would consider following in the very immediate future? |
I can't promise you to get on it soon. But I am generally quick with accepting pull requests :) |
I've had a quick look into this. Storing everything as binary data is quite easy (I came up with a DB migrate file that takes care of this), however REST-assured converts request objects to JSON when responding to the
This won't work with binary data. Not sure whether there's a nice trick we could do to workaround the problem. Another approach would be to return binary data as Base64 strings, however Ruby code that integrates with this Gem needs to explicitly decode it, which is not ideal. |
I see. Well, it's a bit of an edge case, so maybe that's ok? What code needs to examine the double body anyway? I can only think of web ui that comes with the gem. |
Actually the bit of code I linked seems to be run each time something like |
Yeah fair enough. Though the purpose of |
Hello,
I'm unable to send any non-text-based body to an active double, and am unsure as to whether this is by design, or due to error on my behalf.
My Gemfile is as follows:
Steps are as follows:
Note the
Then
is sending a request to simulate the activity of the accompanying java application:This results in the fourth
expect
failing, with the top several stack trace line being:Setting the
POST
body (and expectedrequests.body.first
to be an arbitrary string causes the test to pass. Note also that this error is also seen when sending a validcurl
from the terminal to a live double.Please advise, thank you.
The text was updated successfully, but these errors were encountered: