I’m still a rails newbie, and am looking to learn how to write a unit/functional test. not exactly sure which is best.
I’m writing a controller that parses a POST request. So what I’d like to do is write a test that posts to my controller so I can get the controller setup.
In Rails, whats the right way to get started with this?
I want the post to be a multipart/form-data request with the several parameters like message, subject, from, etc…
Thanks
Rails provides functional tests for this, unit tests are usually for models
You could look at using the rspec_rails gem also, it provides generators for that kind of thing i believe:
https://github.com/rspec/rspec-rails