1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/test/controller
Godfrey Chan 73b1efc58f Lock down new ImplicitRender behavior for 5.0 RC
1. Conceptually revert #20276

   The feature was implemented for the `responders` gem. In the end,
   they did not need that feature, and have found a better fix (see
   plataformatec/responders#131).

   `ImplicitRender` is the place where Rails specifies our default
   policies for the case where the user did not explicitly tell us
   what to render, essentially describing a set of heuristics. If
   the gem (or the user) knows exactly what they want, they could
   just perform the correct `render` to avoid falling through to
   here, as `responders` did (the user called `respond_with`).

   Reverting the patch allows us to avoid exploding the complexity
   and defining “the fallback for a fallback” policies.

2. `respond_to` and templates are considered exhaustive enumerations

   If the user specified a list of formats/variants in a `respond_to`
   block, anything that is not explicitly included should result
   in an `UnknownFormat` error (which is then caught upstream to
   mean “406 Not Acceptable” by default). This is already how it
   works before this commit.

   Same goes for templates – if the user defined a set of templates
   (usually in the file system), that set is now considered exhaustive,
   which means that “missing” templates are considered `UnknownFormat`
   errors (406).

3. To keep API endpoints simple, the implicit render behavior for
   actions with no templates defined at all (regardless of formats,
   locales, variants, etc) are defaulted to “204 No Content”. This
   is a strictly narrower version of the feature landed in #19036 and
   #19377.

4. To avoid confusion when interacting in the browser, these actions
   will raise an `UnknownFormat` error for “interactive” requests
   instead. (The precise definition of “interactive” requests might
   change – the spirit here is to give helpful messages and avoid
   confusions.)

Closes #20666, #23062, #23077, #23564

[Godfrey Chan, Jon Moss, Kasper Timm Hansen, Mike Clark, Matthew Draper]
2016-02-25 01:19:49 -08:00
..
api - Fix warning introduced in 77acc004ef when fixing API responses. 2016-01-22 00:38:12 +05:30
controller_fixtures
metal Test ActionController::Renderers::use_renderers 2015-12-31 13:07:58 -06:00
mime Lock down new ImplicitRender behavior for 5.0 RC 2016-02-25 01:19:49 -08:00
new_base Handle response_body= when body is nil 2016-01-30 09:42:59 -05:00
parameters Show permitted flag in the output of AC::Parameters#inspect 2016-02-24 13:55:37 +05:30
request let the superclass build the request and response 2015-07-08 14:15:53 -07:00
action_pack_assertions_test.rb Use Mime[:foo] instead of Mime::Type[:FOO] for back compat 2015-10-06 11:29:30 -07:00
base_test.rb Push before_sending to super class 2015-12-06 15:32:40 -05:00
caching_test.rb Make collection caching explicit. 2016-02-20 16:54:32 +01:00
content_type_test.rb Use Mime[:foo] instead of Mime::Type[:FOO] for back compat 2015-10-06 11:29:30 -07:00
default_url_options_with_before_action_test.rb Stop using deprecated render :text in test 2015-07-17 22:27:33 -04:00
filters_test.rb Stop using deprecated render :text in test 2015-07-17 22:27:33 -04:00
flash_hash_test.rb Migrate old flash behaviour 2015-01-30 09:47:03 +11:00
flash_test.rb finish deprecating handling strings and symbols 2015-08-07 15:37:31 -07:00
force_ssl_test.rb Fix request.ssl? bug with Action Cable 2016-02-23 16:09:44 -05:00
form_builder_test.rb Override default form builder for a controller 2015-04-13 23:43:34 -04:00
helper_test.rb deletes code commented out in 72160d9f 2015-12-15 22:28:50 -08:00
http_basic_authentication_test.rb Merge pull request #21181 from denisenkom/mypatch 2016-01-10 17:44:43 +01:00
http_digest_authentication_test.rb Stop using deprecated render :text in test 2015-07-17 22:27:33 -04:00
http_token_authentication_test.rb Merge pull request #14212 from tylerhunt/fix-token-regex 2015-12-15 10:59:54 -07:00
integration_test.rb remove args from assert_nothing_raised in tests 2016-02-22 22:56:23 -08:00
live_stream_test.rb disable controller / view thread spawning in tests 2016-02-05 11:42:15 -08:00
localized_templates_test.rb Use public Module#include, in favor of https://bugs.ruby-lang.org/issues/8846 2015-01-31 23:12:41 -05:00
log_subscriber_test.rb tests, test should not care wether 9ms or 11ms have passed. 2015-11-04 16:42:27 -05:00
output_escaping_test.rb remove ancient TODOs [ci skip]. 2013-03-18 16:42:08 +01:00
params_wrapper_test.rb Remove mocha from ActionPack tests 2015-09-05 16:58:40 +02:00
permitted_params_test.rb Stop using deprecated render :text in test 2015-07-17 22:27:33 -04:00
redirect_test.rb Use a URL instead of an URL everywhere 2016-02-15 21:26:14 +05:30
render_js_test.rb Migrating xhr methods to keyword arguments syntax 2015-02-01 16:07:42 +03:00
render_json_test.rb Stop using deprecated render :text in test 2015-07-17 22:27:33 -04:00
render_test.rb Lock down new ImplicitRender behavior for 5.0 RC 2016-02-25 01:19:49 -08:00
render_xml_test.rb Use Mime[:foo] instead of Mime::Type[:FOO] for back compat 2015-10-06 11:29:30 -07:00
renderer_test.rb create a new renderer instance on calls to for 2015-09-14 15:58:12 -07:00
renderers_test.rb Add ActionController:Renderers test 2016-01-03 22:51:45 -06:00
request_forgery_protection_test.rb Make per form token work when method is not provided 2016-02-22 18:40:48 -03:00
required_params_test.rb Add methods to StrongParameters 2016-01-19 12:06:29 -06:00
rescue_test.rb Deprecate exception#original_exception in favor of exception#cause 2015-11-03 06:54:34 -08:00
resources_test.rb Merge pull request #21366 from amitsuroliya/remove_unused_variable 2015-08-25 14:08:17 -03:00
routing_test.rb Revert "Remove literal? check to fix issue with prefixed optionals" 2016-01-20 10:24:33 -05:00
runner_test.rb
send_file_test.rb Use Mime[:foo] instead of Mime::Type[:FOO] for back compat 2015-10-06 11:29:30 -07:00
show_exceptions_test.rb Fix failing tests for #19474 2015-03-23 13:15:59 +00:00
streaming_test.rb
test_case_test.rb Remove unused test controller action 2016-02-16 06:05:17 +00:00
url_for_integration_test.rb Fix route creation when format is a blank string 2015-09-02 09:18:46 -04:00
url_for_test.rb Prevent ActionController::Parameters from being passed to url_for directly 2015-12-15 13:16:54 +01:00
url_rewriter_test.rb remove call to build_request 2015-07-08 15:14:41 -07:00
webservice_test.rb Transform the mime object to symbol when registering the parsers 2016-02-22 21:22:29 -03:00