Add spec showing parse error when request is json
This is a test case for issue #3
that's issue 3 in the remotipart repo https://github.com/JangoSteve/remotipart/issues/3
Thanks @jnimety, I appreciate the test case. However, the reason you are getting a javascript response is because the form doesn't have data-type="json". This is not an issue with remotipart, it's how rails/jquery-ujs does it.
Thanks, I've updated the test to use data-type and it passes, I can't believe I missed that requirement these past few weeks.
I also added a test showing that data-type is not required if there is no attachment, this is still jquery-ujs right? Why is data-type only required if remotipart is used?
I have no idea to be honest. It might be a difference in the way that rails ActionDispatch handles xhr and normal requests differently (i.e. maybe it treats the extension differently between xhr and normal requests). The only difference between remotipart request and normal jquery-ujs requests, is that remotipart is not xhr, it's a normal request/response from an iframe.