I just saw a request by someone on the rspec-users mailing list for support for the OPTIONS http verb in controller specs. See http://rubyforge.org/pipermail/rspec-users/2011-May/020082.html
It makes sense to me that this exist in Rails (as opposed to rspec-rails) since OPTIONS is one of the better ways to figure out what resources do when building RESTful APIs.
I couldn't find where I should write the tests - if you could point me at the file where they're written, I'd be happy to add them.
Ensure that when UrlWriter is included in multiple classes, the defau…
…lt_url_options of one don't affect the other. [#1277 state:resolved]
Signed-off-by: Pratik Naik <firstname.lastname@example.org>
Referring to the nearest method - xml_http_request, I think you better write your test in actionpack/test/controller/integration_test.rb. Please add test, amend your commit, and force-push to your branch.
Since there was a bit more than adding the tests (integration_test.rb covered a few other scenarios) I've added new commits. Please feel free to squash as you see fit.
Do you mind squashed them and rebased your branch against current master ?
@sikachu I have rebased and squashed the commit.
Any chance for this to be merged?
If additionnal work is needed, I may be able to help.
Added a helper to make OPTIONS calls in controller tests
@tjouan I have rebased changes on master again
BTW, it'd be nice to see support for other HTTP (ex: DAV's PROPFIND, PROPPATCH, REPORT, etc) verbs included.
Rather than adding support for a multitude of HTTP request methods I think it makes more sense to make process a public method in integration.rb and leave it at that. It's not too much to ask that tests use process :options, '/path'.
process :options, '/path'
Just for the record OPTIONS support was added in ad46884