foxnewsnetwork / rubyopenvn

Ruby-based implementation of FFOpenVN as ported over from nodejs
1 stars 0 forks source link

How is it getting down there?! #9

Open foxnewsnetwork opened 12 years ago

foxnewsnetwork commented 12 years ago

Elements controller spec throws the following error

9) ElementsController create failure - bad data should render a the flash js page Failure/Error: response.should render_template("errors/flash") expecting <"errors/flash"> but rendering with <"elements/create">

(eval):2:in `assert_block'

 # ./spec/controllers/elements_controller_spec.rb:132:in`block (4 levels) in <top (required)>'

despite the fact the controller is clearly rendering the correct "errors/flash" page instead of the given "elements/create". Run the spec and see if you can't figure out what's wrong.

While you're at it, see if you can't pass the remaining 9 tests in the elements_controller_spec

foxnewsnetwork commented 12 years ago

I think this has to do with xhr requests not being able to submit files and then the rails rspec environment, knowing this, changed my xhr requests to a lame-duck regular html one without bothering to let me know anywhere. This has been one of the more frustrating bugs I've yet dealt with in the development of this project.

foxnewsnetwork commented 12 years ago

Let me just add here that security people who herp-derp the shit out of themselves thinking disallowing ajax-based file UL is somehow making the world a safer place are cunt-bag assholes who help no one and just make other people's lives more complicated.

foxnewsnetwork commented 12 years ago

So the point is that the solution is to simply not do ajax file uploads server side. As in we will use the good ol' iframe method client side to simulate ajax submission, but the server will only ever see file uploads as regular http requests