-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
JSON boolean being converted to strings when testing post call in test env #1755
Comments
|
@JonRowe I just wonder why it's happened only under |
Because your posting Json not a hash in dev
…On Fri, 25 Nov 2016 at 12:55, Toshiki Inami ***@***.***> wrote:
@JonRowe <https://github.com/JonRowe> I just wonder why it's happened
only under test environment. Any ideas?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1755 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJ8oFzIiZC0o1j1fZqUeNvrf4q4o4Ruks5rBkAHgaJpZM4K7muV>
.
|
I’m little confused… Values returned from |
Because your test is sending a hash but a real browser / js sends json
…On Fri, 25 Nov 2016 at 14:02, Toshiki Inami ***@***.***> wrote:
I’m little confused…
Why under only test environment does it post in hash? Is this expected
behaviour from Rails?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1755 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJ8oGL2BlWnFdwoFiun5ifa8AvQ2-DUks5rBk_fgaJpZM4K7muV>
.
|
Thanks I think I understood now, |
I've been testing a JSON request to our API, It will respond with JSON. It seems like all the boolean within the JSON get converted to strings as we post them the endpoint only under test environment.
However
RAILS_ENV=development bundle exec guard
works ok (no conversion), but onceRAILS_ENV=test bundle exec guard
converts all the boolean to string, which is unexpected.This is my test case using mock.
Within end point handler, I could see the values below.
Under
**test environment**
,Under
**development environment**
,Any ideas about pitfalls in test under test environment?
The text was updated successfully, but these errors were encountered: