aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/mime_responds_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Responders now return 204 No Content for API requests without a response ↵José Valim2011-10-261-10/+10
| | | | body (as in the new scaffold)
* ActionPack test fix for RBXArun Agrawal2011-10-241-1/+3
|
* Support symbol and string actions in AC#respond_to optionsAlexey Vakhov2011-10-111-1/+1
|
* JSON responder should return errors with :error rootDenis Odorcic2011-10-101-0/+26
|
* provide a more explicit message when using url_for with nilDamien Mathieu2011-07-021-0/+7
| | | This fixes the problem of having a non-explicit message when the :location option is not provided in respond_with.
* Make sure respond_with with :js tries to render a template in all casesJosé Valim2011-06-301-6/+15
|
* don't raise an exception if the format isn't recognizeddmathieu2011-05-261-0/+6
| | | | Fixed while traveling to heuruko
* Remove `#among?` from Active SupportPrem Sichanugrist2011-04-131-1/+1
| | | | | | After a long list of discussion about the performance problem from using varargs and the reason that we can't find a great pair for it, it would be best to remove support for it for now. It will come back if we can find a good pair for it. For now, Bon Voyage, `#among?`.
* removes the RJS template handlerXavier Noria2011-04-131-28/+1
|
* Change Object#either? to Object#among? -- thanks to @jamesarosen for the ↵David Heinemeier Hansson2011-04-121-1/+1
| | | | suggestion!
* Using Object#in? and Object#either? in various placesPrem Sichanugrist2011-04-111-1/+2
| | | | There're a lot of places in Rails source code which make a lot of sense to switching to Object#in? or Object#either? instead of using [].include?.
* pass respond_with options to controller render when using a template for api ↵Josh Kalderimis2011-03-311-0/+19
| | | | | | navigation Signed-off-by: José Valim <jose.valim@gmail.com>
* only try to display an api template in responders if the request is a get or ↵Josh Kalderimis2011-03-311-0/+21
| | | | | | there are no errors Signed-off-by: José Valim <jose.valim@gmail.com>
* when using respond_with with an invalid resource and custom options, the ↵Josh Kalderimis2011-03-311-0/+17
| | | | | | default response status and error messages should be returned Signed-off-by: José Valim <jose.valim@gmail.com>
* fixing wrong testAaron Patterson2011-01-171-1/+1
|
* A bunch of cleanup on the inherited template patchwycats2010-12-261-1/+1
|
* Fix tests on 1.9.2.José Valim2010-11-281-7/+9
|
* If a user wants json output then try best to render json output. In such ↵Neeraj Singh2010-11-241-0/+18
| | | | | | | | cases prefer kind_of(String) over respond_to?(to_str) [#5841 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* clean up test by using unregister methodNeeraj Singh2010-11-251-12/+6
|
* Remove the not needed setup and teardownNeeraj Singh2010-11-251-3/+0
|
* move the mime registration code to setup so thatNeeraj Singh2010-11-221-2/+19
| | | | | | | | | | | | | | | it could be cleaned up on teardown. Currently the test code test/controller/mime_responds_test.rb impacts test/dispatch/mime_type_test.rb. dispatch/mime_type_test.rb runs independently fine but when run as part of rake breaks because of new mime types registered in controller/mime_responds_test.rb Signed-off-by: José Valim <jose.valim@gmail.com>
* do not assume that there is no space betweenNeeraj Singh2010-11-221-0/+4
| | | | | | leading */* and comma Signed-off-by: José Valim <jose.valim@gmail.com>
* failing test for #6022Neeraj Singh2010-11-221-0/+34
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* current code ignores http header "Accept" if itNeeraj Singh2010-11-221-0/+6
| | | | | | | | | | | has ....,*/* . It is possible to a device to send request such that */* appear at the beginning of the "Accept" header. This patch ensures that "Accept" header is ignored for such cases too. Signed-off-by: José Valim <jose.valim@gmail.com>
* Correctly handle the case of an API response that returns a hash by treating ↵Chris Eppstein2010-11-061-0/+16
| | | | a single hash argument as the resource instead of as options.
* Return a valid empty JSON on successful PUT and DELETE requests. [#5199 ↵Szymon Nowak2010-10-121-0/+19
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Use parentheses when using assert_match followed by a regexp to avoid warnings.Emilio Tagua2010-09-271-2/+2
|
* Removed deprecated RouteSet API, still many tests failPiotr Sarnacki2010-09-051-1/+1
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-5/+5
| | | | 's/[ \t]*$//' -i {} \;)
* Adds tests for content negotiation change introduced in dc5300adb6d46252c26ePatrik Stenmark2010-07-041-0/+20
| | | | Signed-off-by: wycats <wycats@gmail.com>
* Fix a bug where responders were not working properly on method override.José Valim2010-05-241-0/+13
|
* Added missing requireSantiago Pastorino2010-04-161-0/+1
|
* Fixed a bunch of tests that failed in 1.9 because they assumed that a Rack ↵wycats2010-03-191-1/+1
| | | | response was a String.
* ActionController::Base.use_accept_header is not actually used anymore, so ↵Carl Lerche2010-03-031-4/+0
| | | | let's deprecate it.
* Require persisted? in ActiveModel::Lint and remove new_record? and ↵José Valim2010-02-211-2/+2
| | | | destroyed? methods. ActionPack does not care if the resource is new or if it was destroyed, it cares only if it's persisted somewhere or not.
* Improve missing template error messages a little bit.José Valim2010-01-311-1/+1
|
* Raise an error if respond_with is invoked and no format is declared.José Valim2010-01-101-68/+62
|
* Merge branch 'master' of github.com:rails/railsYehuda Katz2009-12-101-3/+5
|\
| * Use new routing dsl in testsJoshua Peek2009-12-081-3/+5
| |
* | Responder redirects to resource if destroy fails.José Valim2009-12-071-8/+34
|/ | | | Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
* Allow ActionController::Responder to have a common entry point for all formats.José Valim2009-12-011-0/+17
| | | | Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
* Split mime responder into smaller chunks and allow action to be configured.José Valim2009-11-131-1/+21
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Unify class_inheritable_accessor and extlib_inheritable_accessor and allow ↵José Valim2009-10-171-0/+8
| | | | responder to be set in the class level.
* Use with_routing helper in tests instead of modifying global route setJoshua Peek2009-10-031-67/+83
|
* Ensure that blocks are also handled inside the responder.José Valim2009-08-291-0/+7
|
* Cleanup route reloading in tests. Prefer with_routing over using ↵Joshua Peek2009-08-161-0/+1
| | | | ActionController::Routing::Routes directly
* Got tests to pass with some more changes.Yehuda Katz2009-08-151-34/+17
| | | | | | | | | | | | | | | | * request.formats is much simpler now * For XHRs or Accept headers with a single item, we use the Accept header * For other requests, we use params[:format] or fallback to HTML * This is primarily to work around the fact that browsers provide completely broken Accept headers, so we have to whitelist the few cases we can specifically isolate and treat other requests as coming from the browser * For APIs, we can support single-item Accept headers, which disambiguates from the browsers * Requests to an action that only has an XML template from the browser will no longer find the template. This worked previously because most browsers provide a catch-all */*, but this was mostly accidental behavior. If you want to serve XML, either use the :xml format in links, or explicitly specify the XML template: render "template.xml".
* Ensure collections are not treated as nested resources.José Valim2009-08-131-7/+20
|
* Renamed ActionController::Renderer to ActionController::Responder and ↵José Valim2009-08-081-5/+5
| | | | ActionController::MimeResponds::Responder to ActionController::MimeResponds::Collector.
* Renamed presenter to renderer, added some documentation and defined its API.José Valim2009-08-071-4/+18
|