jets 1.4.11 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1027) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +3 -0
  3. data/CHANGELOG.md +4 -0
  4. data/Gemfile.lock +6 -5
  5. data/jets.gemspec +3 -2
  6. data/lib/jets.rb +8 -2
  7. data/lib/jets/builders/tidy.rb +2 -1
  8. data/lib/jets/commands/db.rb +3 -3
  9. data/lib/jets/commands/db/tasks.rb +5 -4
  10. data/lib/jets/generator.rb +3 -2
  11. data/lib/jets/router.rb +29 -4
  12. data/lib/jets/router/scope.rb +30 -0
  13. data/lib/jets/version.rb +1 -1
  14. data/vendor/rails/Brewfile +13 -0
  15. data/vendor/rails/CODE_OF_CONDUCT.md +12 -0
  16. data/vendor/rails/CONTRIBUTING.md +49 -0
  17. data/vendor/rails/Gemfile +174 -0
  18. data/vendor/rails/Gemfile.lock +564 -0
  19. data/vendor/rails/MIT-LICENSE +20 -0
  20. data/vendor/rails/RAILS_VERSION +1 -0
  21. data/vendor/rails/README.md +97 -0
  22. data/vendor/rails/RELEASING_RAILS.md +225 -0
  23. data/vendor/rails/Rakefile +72 -0
  24. data/vendor/rails/actionpack/CHANGELOG.md +407 -0
  25. data/vendor/rails/actionpack/MIT-LICENSE +21 -0
  26. data/vendor/rails/actionpack/README.rdoc +57 -0
  27. data/vendor/rails/actionpack/Rakefile +40 -0
  28. data/vendor/rails/actionpack/actionpack.gemspec +38 -0
  29. data/vendor/rails/actionpack/bin/test +5 -0
  30. data/vendor/rails/actionpack/lib/abstract_controller.rb +27 -0
  31. data/vendor/rails/actionpack/lib/abstract_controller/asset_paths.rb +12 -0
  32. data/vendor/rails/actionpack/lib/abstract_controller/base.rb +265 -0
  33. data/vendor/rails/actionpack/lib/abstract_controller/caching.rb +66 -0
  34. data/vendor/rails/actionpack/lib/abstract_controller/caching/fragments.rb +166 -0
  35. data/vendor/rails/actionpack/lib/abstract_controller/callbacks.rb +212 -0
  36. data/vendor/rails/actionpack/lib/abstract_controller/collector.rb +43 -0
  37. data/vendor/rails/actionpack/lib/abstract_controller/error.rb +6 -0
  38. data/vendor/rails/actionpack/lib/abstract_controller/helpers.rb +194 -0
  39. data/vendor/rails/actionpack/lib/abstract_controller/logger.rb +14 -0
  40. data/vendor/rails/actionpack/lib/abstract_controller/railties/routes_helpers.rb +20 -0
  41. data/vendor/rails/actionpack/lib/abstract_controller/rendering.rb +127 -0
  42. data/vendor/rails/actionpack/lib/abstract_controller/translation.rb +31 -0
  43. data/vendor/rails/actionpack/lib/abstract_controller/url_for.rb +35 -0
  44. data/vendor/rails/actionpack/lib/action_controller.rb +66 -0
  45. data/vendor/rails/actionpack/lib/action_controller/api.rb +149 -0
  46. data/vendor/rails/actionpack/lib/action_controller/api/api_rendering.rb +16 -0
  47. data/vendor/rails/actionpack/lib/action_controller/base.rb +276 -0
  48. data/vendor/rails/actionpack/lib/action_controller/caching.rb +46 -0
  49. data/vendor/rails/actionpack/lib/action_controller/form_builder.rb +50 -0
  50. data/vendor/rails/actionpack/lib/action_controller/log_subscriber.rb +78 -0
  51. data/vendor/rails/actionpack/lib/action_controller/metal.rb +256 -0
  52. data/vendor/rails/actionpack/lib/action_controller/metal/basic_implicit_render.rb +13 -0
  53. data/vendor/rails/actionpack/lib/action_controller/metal/conditional_get.rb +274 -0
  54. data/vendor/rails/actionpack/lib/action_controller/metal/content_security_policy.rb +52 -0
  55. data/vendor/rails/actionpack/lib/action_controller/metal/cookies.rb +16 -0
  56. data/vendor/rails/actionpack/lib/action_controller/metal/data_streaming.rb +152 -0
  57. data/vendor/rails/actionpack/lib/action_controller/metal/etag_with_flash.rb +18 -0
  58. data/vendor/rails/actionpack/lib/action_controller/metal/etag_with_template_digest.rb +57 -0
  59. data/vendor/rails/actionpack/lib/action_controller/metal/exceptions.rb +53 -0
  60. data/vendor/rails/actionpack/lib/action_controller/metal/flash.rb +61 -0
  61. data/vendor/rails/actionpack/lib/action_controller/metal/force_ssl.rb +99 -0
  62. data/vendor/rails/actionpack/lib/action_controller/metal/head.rb +60 -0
  63. data/vendor/rails/actionpack/lib/action_controller/metal/helpers.rb +123 -0
  64. data/vendor/rails/actionpack/lib/action_controller/metal/http_authentication.rb +519 -0
  65. data/vendor/rails/actionpack/lib/action_controller/metal/implicit_render.rb +73 -0
  66. data/vendor/rails/actionpack/lib/action_controller/metal/instrumentation.rb +107 -0
  67. data/vendor/rails/actionpack/lib/action_controller/metal/live.rb +312 -0
  68. data/vendor/rails/actionpack/lib/action_controller/metal/mime_responds.rb +313 -0
  69. data/vendor/rails/actionpack/lib/action_controller/metal/parameter_encoding.rb +51 -0
  70. data/vendor/rails/actionpack/lib/action_controller/metal/params_wrapper.rb +293 -0
  71. data/vendor/rails/actionpack/lib/action_controller/metal/redirecting.rb +133 -0
  72. data/vendor/rails/actionpack/lib/action_controller/metal/renderers.rb +181 -0
  73. data/vendor/rails/actionpack/lib/action_controller/metal/rendering.rb +122 -0
  74. data/vendor/rails/actionpack/lib/action_controller/metal/request_forgery_protection.rb +445 -0
  75. data/vendor/rails/actionpack/lib/action_controller/metal/rescue.rb +28 -0
  76. data/vendor/rails/actionpack/lib/action_controller/metal/streaming.rb +223 -0
  77. data/vendor/rails/actionpack/lib/action_controller/metal/strong_parameters.rb +1086 -0
  78. data/vendor/rails/actionpack/lib/action_controller/metal/testing.rb +16 -0
  79. data/vendor/rails/actionpack/lib/action_controller/metal/url_for.rb +58 -0
  80. data/vendor/rails/actionpack/lib/action_controller/railtie.rb +89 -0
  81. data/vendor/rails/actionpack/lib/action_controller/railties/helpers.rb +24 -0
  82. data/vendor/rails/actionpack/lib/action_controller/renderer.rb +117 -0
  83. data/vendor/rails/actionpack/lib/action_controller/template_assertions.rb +11 -0
  84. data/vendor/rails/actionpack/lib/action_controller/test_case.rb +629 -0
  85. data/vendor/rails/actionpack/lib/action_dispatch.rb +112 -0
  86. data/vendor/rails/actionpack/lib/action_dispatch/http/cache.rb +220 -0
  87. data/vendor/rails/actionpack/lib/action_dispatch/http/content_security_policy.rb +272 -0
  88. data/vendor/rails/actionpack/lib/action_dispatch/http/filter_parameters.rb +84 -0
  89. data/vendor/rails/actionpack/lib/action_dispatch/http/filter_redirect.rb +37 -0
  90. data/vendor/rails/actionpack/lib/action_dispatch/http/headers.rb +132 -0
  91. data/vendor/rails/actionpack/lib/action_dispatch/http/mime_negotiation.rb +170 -0
  92. data/vendor/rails/actionpack/lib/action_dispatch/http/mime_type.rb +342 -0
  93. data/vendor/rails/actionpack/lib/action_dispatch/http/mime_types.rb +50 -0
  94. data/vendor/rails/actionpack/lib/action_dispatch/http/parameter_filter.rb +86 -0
  95. data/vendor/rails/actionpack/lib/action_dispatch/http/parameters.rb +126 -0
  96. data/vendor/rails/actionpack/lib/action_dispatch/http/rack_cache.rb +63 -0
  97. data/vendor/rails/actionpack/lib/action_dispatch/http/request.rb +430 -0
  98. data/vendor/rails/actionpack/lib/action_dispatch/http/response.rb +520 -0
  99. data/vendor/rails/actionpack/lib/action_dispatch/http/upload.rb +84 -0
  100. data/vendor/rails/actionpack/lib/action_dispatch/http/url.rb +350 -0
  101. data/vendor/rails/actionpack/lib/action_dispatch/journey.rb +7 -0
  102. data/vendor/rails/actionpack/lib/action_dispatch/journey/formatter.rb +189 -0
  103. data/vendor/rails/actionpack/lib/action_dispatch/journey/gtg/builder.rb +164 -0
  104. data/vendor/rails/actionpack/lib/action_dispatch/journey/gtg/simulator.rb +41 -0
  105. data/vendor/rails/actionpack/lib/action_dispatch/journey/gtg/transition_table.rb +158 -0
  106. data/vendor/rails/actionpack/lib/action_dispatch/journey/nfa/builder.rb +78 -0
  107. data/vendor/rails/actionpack/lib/action_dispatch/journey/nfa/dot.rb +36 -0
  108. data/vendor/rails/actionpack/lib/action_dispatch/journey/nfa/simulator.rb +49 -0
  109. data/vendor/rails/actionpack/lib/action_dispatch/journey/nfa/transition_table.rb +120 -0
  110. data/vendor/rails/actionpack/lib/action_dispatch/journey/nodes/node.rb +140 -0
  111. data/vendor/rails/actionpack/lib/action_dispatch/journey/parser.rb +199 -0
  112. data/vendor/rails/actionpack/lib/action_dispatch/journey/parser.y +50 -0
  113. data/vendor/rails/actionpack/lib/action_dispatch/journey/parser_extras.rb +31 -0
  114. data/vendor/rails/actionpack/lib/action_dispatch/journey/path/pattern.rb +198 -0
  115. data/vendor/rails/actionpack/lib/action_dispatch/journey/route.rb +203 -0
  116. data/vendor/rails/actionpack/lib/action_dispatch/journey/router.rb +156 -0
  117. data/vendor/rails/actionpack/lib/action_dispatch/journey/router/utils.rb +102 -0
  118. data/vendor/rails/actionpack/lib/action_dispatch/journey/routes.rb +82 -0
  119. data/vendor/rails/actionpack/lib/action_dispatch/journey/scanner.rb +64 -0
  120. data/vendor/rails/actionpack/lib/action_dispatch/journey/visitors.rb +268 -0
  121. data/vendor/rails/actionpack/lib/action_dispatch/journey/visualizer/fsm.css +30 -0
  122. data/vendor/rails/actionpack/lib/action_dispatch/journey/visualizer/fsm.js +134 -0
  123. data/vendor/rails/actionpack/lib/action_dispatch/journey/visualizer/index.html.erb +52 -0
  124. data/vendor/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb +36 -0
  125. data/vendor/rails/actionpack/lib/action_dispatch/middleware/cookies.rb +685 -0
  126. data/vendor/rails/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb +205 -0
  127. data/vendor/rails/actionpack/lib/action_dispatch/middleware/debug_locks.rb +124 -0
  128. data/vendor/rails/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb +147 -0
  129. data/vendor/rails/actionpack/lib/action_dispatch/middleware/executor.rb +21 -0
  130. data/vendor/rails/actionpack/lib/action_dispatch/middleware/flash.rb +300 -0
  131. data/vendor/rails/actionpack/lib/action_dispatch/middleware/public_exceptions.rb +57 -0
  132. data/vendor/rails/actionpack/lib/action_dispatch/middleware/reloader.rb +12 -0
  133. data/vendor/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb +183 -0
  134. data/vendor/rails/actionpack/lib/action_dispatch/middleware/request_id.rb +43 -0
  135. data/vendor/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb +92 -0
  136. data/vendor/rails/actionpack/lib/action_dispatch/middleware/session/cache_store.rb +54 -0
  137. data/vendor/rails/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb +117 -0
  138. data/vendor/rails/actionpack/lib/action_dispatch/middleware/session/mem_cache_store.rb +28 -0
  139. data/vendor/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb +62 -0
  140. data/vendor/rails/actionpack/lib/action_dispatch/middleware/ssl.rb +150 -0
  141. data/vendor/rails/actionpack/lib/action_dispatch/middleware/stack.rb +116 -0
  142. data/vendor/rails/actionpack/lib/action_dispatch/middleware/static.rb +130 -0
  143. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +22 -0
  144. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb +23 -0
  145. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.html.erb +27 -0
  146. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.text.erb +8 -0
  147. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb +52 -0
  148. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb +9 -0
  149. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb +16 -0
  150. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb +9 -0
  151. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb +21 -0
  152. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb +13 -0
  153. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/layout.erb +161 -0
  154. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb +11 -0
  155. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.text.erb +3 -0
  156. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb +32 -0
  157. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.text.erb +11 -0
  158. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +20 -0
  159. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.text.erb +7 -0
  160. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.html.erb +6 -0
  161. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.text.erb +3 -0
  162. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/routes/_route.html.erb +16 -0
  163. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/routes/_table.html.erb +200 -0
  164. data/vendor/rails/actionpack/lib/action_dispatch/railtie.rb +55 -0
  165. data/vendor/rails/actionpack/lib/action_dispatch/request/session.rb +234 -0
  166. data/vendor/rails/actionpack/lib/action_dispatch/request/utils.rb +78 -0
  167. data/vendor/rails/actionpack/lib/action_dispatch/routing.rb +260 -0
  168. data/vendor/rails/actionpack/lib/action_dispatch/routing/endpoint.rb +17 -0
  169. data/vendor/rails/actionpack/lib/action_dispatch/routing/inspector.rb +225 -0
  170. data/vendor/rails/actionpack/lib/action_dispatch/routing/mapper.rb +2267 -0
  171. data/vendor/rails/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb +352 -0
  172. data/vendor/rails/actionpack/lib/action_dispatch/routing/redirection.rb +201 -0
  173. data/vendor/rails/actionpack/lib/action_dispatch/routing/route_set.rb +890 -0
  174. data/vendor/rails/actionpack/lib/action_dispatch/routing/routes_proxy.rb +69 -0
  175. data/vendor/rails/actionpack/lib/action_dispatch/routing/url_for.rb +236 -0
  176. data/vendor/rails/actionpack/lib/action_dispatch/system_test_case.rb +147 -0
  177. data/vendor/rails/actionpack/lib/action_dispatch/system_testing/browser.rb +49 -0
  178. data/vendor/rails/actionpack/lib/action_dispatch/system_testing/driver.rb +59 -0
  179. data/vendor/rails/actionpack/lib/action_dispatch/system_testing/server.rb +31 -0
  180. data/vendor/rails/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +96 -0
  181. data/vendor/rails/actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +31 -0
  182. data/vendor/rails/actionpack/lib/action_dispatch/system_testing/test_helpers/undef_methods.rb +26 -0
  183. data/vendor/rails/actionpack/lib/action_dispatch/testing/assertion_response.rb +47 -0
  184. data/vendor/rails/actionpack/lib/action_dispatch/testing/assertions.rb +24 -0
  185. data/vendor/rails/actionpack/lib/action_dispatch/testing/assertions/response.rb +107 -0
  186. data/vendor/rails/actionpack/lib/action_dispatch/testing/assertions/routing.rb +222 -0
  187. data/vendor/rails/actionpack/lib/action_dispatch/testing/integration.rb +652 -0
  188. data/vendor/rails/actionpack/lib/action_dispatch/testing/request_encoder.rb +55 -0
  189. data/vendor/rails/actionpack/lib/action_dispatch/testing/test_process.rb +50 -0
  190. data/vendor/rails/actionpack/lib/action_dispatch/testing/test_request.rb +71 -0
  191. data/vendor/rails/actionpack/lib/action_dispatch/testing/test_response.rb +53 -0
  192. data/vendor/rails/actionpack/lib/action_pack.rb +26 -0
  193. data/vendor/rails/actionpack/lib/action_pack/gem_version.rb +17 -0
  194. data/vendor/rails/actionpack/lib/action_pack/version.rb +10 -0
  195. data/vendor/rails/actionpack/test/abstract/callbacks_test.rb +270 -0
  196. data/vendor/rails/actionpack/test/abstract/collector_test.rb +65 -0
  197. data/vendor/rails/actionpack/test/abstract/translation_test.rb +79 -0
  198. data/vendor/rails/actionpack/test/abstract_unit.rb +457 -0
  199. data/vendor/rails/actionpack/test/assertions/response_assertions_test.rb +141 -0
  200. data/vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb +493 -0
  201. data/vendor/rails/actionpack/test/controller/api/conditional_get_test.rb +59 -0
  202. data/vendor/rails/actionpack/test/controller/api/data_streaming_test.rb +28 -0
  203. data/vendor/rails/actionpack/test/controller/api/force_ssl_test.rb +22 -0
  204. data/vendor/rails/actionpack/test/controller/api/implicit_render_test.rb +17 -0
  205. data/vendor/rails/actionpack/test/controller/api/params_wrapper_test.rb +28 -0
  206. data/vendor/rails/actionpack/test/controller/api/redirect_to_test.rb +21 -0
  207. data/vendor/rails/actionpack/test/controller/api/renderers_test.rb +50 -0
  208. data/vendor/rails/actionpack/test/controller/api/url_for_test.rb +22 -0
  209. data/vendor/rails/actionpack/test/controller/api/with_cookies_test.rb +23 -0
  210. data/vendor/rails/actionpack/test/controller/api/with_helpers_test.rb +44 -0
  211. data/vendor/rails/actionpack/test/controller/base_test.rb +323 -0
  212. data/vendor/rails/actionpack/test/controller/caching_test.rb +511 -0
  213. data/vendor/rails/actionpack/test/controller/content_type_test.rb +169 -0
  214. data/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/admin/user_controller.rb +0 -0
  215. data/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/user_controller.rb +0 -0
  216. data/vendor/rails/actionpack/test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib/plugin_controller.rb +0 -0
  217. data/vendor/rails/actionpack/test/controller/default_url_options_with_before_action_test.rb +28 -0
  218. data/vendor/rails/actionpack/test/controller/filters_test.rb +1050 -0
  219. data/vendor/rails/actionpack/test/controller/flash_hash_test.rb +216 -0
  220. data/vendor/rails/actionpack/test/controller/flash_test.rb +373 -0
  221. data/vendor/rails/actionpack/test/controller/force_ssl_test.rb +333 -0
  222. data/vendor/rails/actionpack/test/controller/form_builder_test.rb +19 -0
  223. data/vendor/rails/actionpack/test/controller/helper_test.rb +295 -0
  224. data/vendor/rails/actionpack/test/controller/http_basic_authentication_test.rb +179 -0
  225. data/vendor/rails/actionpack/test/controller/http_digest_authentication_test.rb +282 -0
  226. data/vendor/rails/actionpack/test/controller/http_token_authentication_test.rb +216 -0
  227. data/vendor/rails/actionpack/test/controller/integration_test.rb +1136 -0
  228. data/vendor/rails/actionpack/test/controller/live_stream_test.rb +518 -0
  229. data/vendor/rails/actionpack/test/controller/localized_templates_test.rb +48 -0
  230. data/vendor/rails/actionpack/test/controller/log_subscriber_test.rb +371 -0
  231. data/vendor/rails/actionpack/test/controller/metal/renderers_test.rb +50 -0
  232. data/vendor/rails/actionpack/test/controller/metal_test.rb +32 -0
  233. data/vendor/rails/actionpack/test/controller/mime/accept_format_test.rb +94 -0
  234. data/vendor/rails/actionpack/test/controller/mime/respond_to_test.rb +843 -0
  235. data/vendor/rails/actionpack/test/controller/new_base/bare_metal_test.rb +184 -0
  236. data/vendor/rails/actionpack/test/controller/new_base/base_test.rb +131 -0
  237. data/vendor/rails/actionpack/test/controller/new_base/content_negotiation_test.rb +28 -0
  238. data/vendor/rails/actionpack/test/controller/new_base/content_type_test.rb +116 -0
  239. data/vendor/rails/actionpack/test/controller/new_base/middleware_test.rb +112 -0
  240. data/vendor/rails/actionpack/test/controller/new_base/render_action_test.rb +314 -0
  241. data/vendor/rails/actionpack/test/controller/new_base/render_body_test.rb +172 -0
  242. data/vendor/rails/actionpack/test/controller/new_base/render_context_test.rb +54 -0
  243. data/vendor/rails/actionpack/test/controller/new_base/render_file_test.rb +72 -0
  244. data/vendor/rails/actionpack/test/controller/new_base/render_html_test.rb +192 -0
  245. data/vendor/rails/actionpack/test/controller/new_base/render_implicit_action_test.rb +59 -0
  246. data/vendor/rails/actionpack/test/controller/new_base/render_layout_test.rb +128 -0
  247. data/vendor/rails/actionpack/test/controller/new_base/render_partial_test.rb +62 -0
  248. data/vendor/rails/actionpack/test/controller/new_base/render_plain_test.rb +170 -0
  249. data/vendor/rails/actionpack/test/controller/new_base/render_streaming_test.rb +116 -0
  250. data/vendor/rails/actionpack/test/controller/new_base/render_template_test.rb +240 -0
  251. data/vendor/rails/actionpack/test/controller/new_base/render_test.rb +142 -0
  252. data/vendor/rails/actionpack/test/controller/new_base/render_xml_test.rb +12 -0
  253. data/vendor/rails/actionpack/test/controller/output_escaping_test.rb +17 -0
  254. data/vendor/rails/actionpack/test/controller/parameter_encoding_test.rb +52 -0
  255. data/vendor/rails/actionpack/test/controller/parameters/accessors_test.rb +324 -0
  256. data/vendor/rails/actionpack/test/controller/parameters/always_permitted_parameters_test.rb +30 -0
  257. data/vendor/rails/actionpack/test/controller/parameters/dup_test.rb +67 -0
  258. data/vendor/rails/actionpack/test/controller/parameters/log_on_unpermitted_params_test.rb +70 -0
  259. data/vendor/rails/actionpack/test/controller/parameters/multi_parameter_attributes_test.rb +39 -0
  260. data/vendor/rails/actionpack/test/controller/parameters/mutators_test.rb +122 -0
  261. data/vendor/rails/actionpack/test/controller/parameters/nested_parameters_permit_test.rb +184 -0
  262. data/vendor/rails/actionpack/test/controller/parameters/parameters_permit_test.rb +516 -0
  263. data/vendor/rails/actionpack/test/controller/parameters/raise_on_unpermitted_params_test.rb +33 -0
  264. data/vendor/rails/actionpack/test/controller/parameters/serialization_test.rb +55 -0
  265. data/vendor/rails/actionpack/test/controller/params_wrapper_test.rb +422 -0
  266. data/vendor/rails/actionpack/test/controller/permitted_params_test.rb +27 -0
  267. data/vendor/rails/actionpack/test/controller/redirect_test.rb +395 -0
  268. data/vendor/rails/actionpack/test/controller/render_js_test.rb +36 -0
  269. data/vendor/rails/actionpack/test/controller/render_json_test.rb +137 -0
  270. data/vendor/rails/actionpack/test/controller/render_test.rb +843 -0
  271. data/vendor/rails/actionpack/test/controller/render_xml_test.rb +102 -0
  272. data/vendor/rails/actionpack/test/controller/renderer_test.rb +136 -0
  273. data/vendor/rails/actionpack/test/controller/renderers_test.rb +91 -0
  274. data/vendor/rails/actionpack/test/controller/request/test_request_test.rb +42 -0
  275. data/vendor/rails/actionpack/test/controller/request_forgery_protection_test.rb +1013 -0
  276. data/vendor/rails/actionpack/test/controller/required_params_test.rb +100 -0
  277. data/vendor/rails/actionpack/test/controller/rescue_test.rb +364 -0
  278. data/vendor/rails/actionpack/test/controller/resources_test.rb +1369 -0
  279. data/vendor/rails/actionpack/test/controller/routing_test.rb +2108 -0
  280. data/vendor/rails/actionpack/test/controller/runner_test.rb +24 -0
  281. data/vendor/rails/actionpack/test/controller/send_file_test.rb +259 -0
  282. data/vendor/rails/actionpack/test/controller/show_exceptions_test.rb +114 -0
  283. data/vendor/rails/actionpack/test/controller/streaming_test.rb +28 -0
  284. data/vendor/rails/actionpack/test/controller/test_case_test.rb +1157 -0
  285. data/vendor/rails/actionpack/test/controller/url_for_integration_test.rb +192 -0
  286. data/vendor/rails/actionpack/test/controller/url_for_test.rb +519 -0
  287. data/vendor/rails/actionpack/test/controller/url_rewriter_test.rb +92 -0
  288. data/vendor/rails/actionpack/test/controller/webservice_test.rb +135 -0
  289. data/vendor/rails/actionpack/test/dispatch/callbacks_test.rb +47 -0
  290. data/vendor/rails/actionpack/test/dispatch/content_security_policy_test.rb +525 -0
  291. data/vendor/rails/actionpack/test/dispatch/cookies_test.rb +1345 -0
  292. data/vendor/rails/actionpack/test/dispatch/debug_exceptions_test.rb +502 -0
  293. data/vendor/rails/actionpack/test/dispatch/debug_locks_test.rb +38 -0
  294. data/vendor/rails/actionpack/test/dispatch/exception_wrapper_test.rb +120 -0
  295. data/vendor/rails/actionpack/test/dispatch/executor_test.rb +136 -0
  296. data/vendor/rails/actionpack/test/dispatch/header_test.rb +169 -0
  297. data/vendor/rails/actionpack/test/dispatch/live_response_test.rb +98 -0
  298. data/vendor/rails/actionpack/test/dispatch/mapper_test.rb +210 -0
  299. data/vendor/rails/actionpack/test/dispatch/middleware_stack_test.rb +115 -0
  300. data/vendor/rails/actionpack/test/dispatch/mime_type_test.rb +187 -0
  301. data/vendor/rails/actionpack/test/dispatch/mount_test.rb +95 -0
  302. data/vendor/rails/actionpack/test/dispatch/prefix_generation_test.rb +463 -0
  303. data/vendor/rails/actionpack/test/dispatch/rack_cache_test.rb +23 -0
  304. data/vendor/rails/actionpack/test/dispatch/reloader_test.rb +167 -0
  305. data/vendor/rails/actionpack/test/dispatch/request/json_params_parsing_test.rb +207 -0
  306. data/vendor/rails/actionpack/test/dispatch/request/multipart_params_parsing_test.rb +202 -0
  307. data/vendor/rails/actionpack/test/dispatch/request/query_string_parsing_test.rb +176 -0
  308. data/vendor/rails/actionpack/test/dispatch/request/session_test.rb +165 -0
  309. data/vendor/rails/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb +181 -0
  310. data/vendor/rails/actionpack/test/dispatch/request_id_test.rb +75 -0
  311. data/vendor/rails/actionpack/test/dispatch/request_test.rb +1307 -0
  312. data/vendor/rails/actionpack/test/dispatch/response_test.rb +542 -0
  313. data/vendor/rails/actionpack/test/dispatch/routing/concerns_test.rb +124 -0
  314. data/vendor/rails/actionpack/test/dispatch/routing/custom_url_helpers_test.rb +333 -0
  315. data/vendor/rails/actionpack/test/dispatch/routing/inspector_test.rb +425 -0
  316. data/vendor/rails/actionpack/test/dispatch/routing/ipv6_redirect_test.rb +46 -0
  317. data/vendor/rails/actionpack/test/dispatch/routing/route_set_test.rb +166 -0
  318. data/vendor/rails/actionpack/test/dispatch/routing_assertions_test.rb +209 -0
  319. data/vendor/rails/actionpack/test/dispatch/routing_test.rb +5112 -0
  320. data/vendor/rails/actionpack/test/dispatch/runner_test.rb +19 -0
  321. data/vendor/rails/actionpack/test/dispatch/session/abstract_store_test.rb +58 -0
  322. data/vendor/rails/actionpack/test/dispatch/session/cache_store_test.rb +183 -0
  323. data/vendor/rails/actionpack/test/dispatch/session/cookie_store_test.rb +417 -0
  324. data/vendor/rails/actionpack/test/dispatch/session/mem_cache_store_test.rb +205 -0
  325. data/vendor/rails/actionpack/test/dispatch/session/test_session_test.rb +65 -0
  326. data/vendor/rails/actionpack/test/dispatch/show_exceptions_test.rb +138 -0
  327. data/vendor/rails/actionpack/test/dispatch/ssl_test.rb +228 -0
  328. data/vendor/rails/actionpack/test/dispatch/static_test.rb +318 -0
  329. data/vendor/rails/actionpack/test/dispatch/system_testing/driver_test.rb +54 -0
  330. data/vendor/rails/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb +81 -0
  331. data/vendor/rails/actionpack/test/dispatch/system_testing/server_test.rb +32 -0
  332. data/vendor/rails/actionpack/test/dispatch/system_testing/system_test_case_test.rb +84 -0
  333. data/vendor/rails/actionpack/test/dispatch/test_request_test.rb +131 -0
  334. data/vendor/rails/actionpack/test/dispatch/test_response_test.rb +37 -0
  335. data/vendor/rails/actionpack/test/dispatch/uploaded_file_test.rb +113 -0
  336. data/vendor/rails/actionpack/test/dispatch/url_generation_test.rb +141 -0
  337. data/vendor/rails/actionpack/test/fixtures/_top_level_partial_only.erb +1 -0
  338. data/vendor/rails/actionpack/test/fixtures/alternate_helpers/foo_helper.rb +5 -0
  339. data/vendor/rails/actionpack/test/fixtures/bad_customers/_bad_customer.html.erb +1 -0
  340. data/vendor/rails/actionpack/test/fixtures/collection_cache/index.html.erb +1 -0
  341. data/vendor/rails/actionpack/test/fixtures/company.rb +11 -0
  342. data/vendor/rails/actionpack/test/fixtures/customers/_commented_customer.html.erb +5 -0
  343. data/vendor/rails/actionpack/test/fixtures/customers/_customer.html.erb +4 -0
  344. data/vendor/rails/actionpack/test/fixtures/filter_test/implicit_actions/edit.html.erb +1 -0
  345. data/vendor/rails/actionpack/test/fixtures/filter_test/implicit_actions/show.html.erb +1 -0
  346. data/vendor/rails/actionpack/test/fixtures/functional_caching/_formatted_partial.html.erb +1 -0
  347. data/vendor/rails/actionpack/test/fixtures/functional_caching/_partial.erb +3 -0
  348. data/vendor/rails/actionpack/test/fixtures/functional_caching/formatted_fragment_cached.html.erb +3 -0
  349. data/vendor/rails/actionpack/test/fixtures/functional_caching/formatted_fragment_cached.xml.builder +5 -0
  350. data/vendor/rails/actionpack/test/fixtures/functional_caching/formatted_fragment_cached_with_variant.html+phone.erb +3 -0
  351. data/vendor/rails/actionpack/test/fixtures/functional_caching/fragment_cached.html.erb +3 -0
  352. data/vendor/rails/actionpack/test/fixtures/functional_caching/fragment_cached_with_options.html.erb +3 -0
  353. data/vendor/rails/actionpack/test/fixtures/functional_caching/fragment_cached_without_digest.html.erb +3 -0
  354. data/vendor/rails/actionpack/test/fixtures/functional_caching/html_fragment_cached_with_partial.html.erb +1 -0
  355. data/vendor/rails/actionpack/test/fixtures/functional_caching/inline_fragment_cached.html.erb +2 -0
  356. data/vendor/rails/actionpack/test/fixtures/functional_caching/xml_fragment_cached_with_html_partial.xml.builder +5 -0
  357. data/vendor/rails/actionpack/test/fixtures/helpers/abc_helper.rb +5 -0
  358. data/vendor/rails/actionpack/test/fixtures/helpers/fun/games_helper.rb +7 -0
  359. data/vendor/rails/actionpack/test/fixtures/helpers/fun/pdf_helper.rb +7 -0
  360. data/vendor/rails/actionpack/test/fixtures/helpers/just_me_helper.rb +5 -0
  361. data/vendor/rails/actionpack/test/fixtures/helpers/me_too_helper.rb +5 -0
  362. data/vendor/rails/actionpack/test/fixtures/helpers1_pack/pack1_helper.rb +7 -0
  363. data/vendor/rails/actionpack/test/fixtures/helpers2_pack/pack2_helper.rb +7 -0
  364. data/vendor/rails/actionpack/test/fixtures/helpers_typo/admin/users_helper.rb +6 -0
  365. data/vendor/rails/actionpack/test/fixtures/implicit_render_test/empty_action_with_mobile_variant.html+mobile.erb +1 -0
  366. data/vendor/rails/actionpack/test/fixtures/implicit_render_test/empty_action_with_template.html.erb +1 -0
  367. data/vendor/rails/actionpack/test/fixtures/layouts/_customers.erb +1 -0
  368. data/vendor/rails/actionpack/test/fixtures/layouts/block_with_layout.erb +3 -0
  369. data/vendor/rails/actionpack/test/fixtures/layouts/builder.builder +3 -0
  370. data/vendor/rails/actionpack/test/fixtures/layouts/partial_with_layout.erb +3 -0
  371. data/vendor/rails/actionpack/test/fixtures/layouts/standard.html.erb +1 -0
  372. data/vendor/rails/actionpack/test/fixtures/layouts/talk_from_action.erb +2 -0
  373. data/vendor/rails/actionpack/test/fixtures/layouts/with_html_partial.html.erb +1 -0
  374. data/vendor/rails/actionpack/test/fixtures/layouts/xhr.html.erb +2 -0
  375. data/vendor/rails/actionpack/test/fixtures/layouts/yield.erb +2 -0
  376. data/vendor/rails/actionpack/test/fixtures/load_me.rb +4 -0
  377. data/vendor/rails/actionpack/test/fixtures/localized/hello_world.de.html +1 -0
  378. data/vendor/rails/actionpack/test/fixtures/localized/hello_world.en.html +1 -0
  379. data/vendor/rails/actionpack/test/fixtures/localized/hello_world.it.erb +1 -0
  380. data/vendor/rails/actionpack/test/fixtures/multipart/binary_file +0 -0
  381. data/vendor/rails/actionpack/test/fixtures/multipart/boundary_problem_file +10 -0
  382. data/vendor/rails/actionpack/test/fixtures/multipart/bracketed_param +5 -0
  383. data/vendor/rails/actionpack/test/fixtures/multipart/bracketed_utf8_param +5 -0
  384. data/vendor/rails/actionpack/test/fixtures/multipart/empty +10 -0
  385. data/vendor/rails/actionpack/test/fixtures/multipart/hello.txt +1 -0
  386. data/vendor/rails/actionpack/test/fixtures/multipart/large_text_file +10 -0
  387. data/vendor/rails/actionpack/test/fixtures/multipart/mixed_files +0 -0
  388. data/vendor/rails/actionpack/test/fixtures/multipart/none +9 -0
  389. data/vendor/rails/actionpack/test/fixtures/multipart/ruby_on_rails.jpg +0 -0
  390. data/vendor/rails/actionpack/test/fixtures/multipart/single_parameter +5 -0
  391. data/vendor/rails/actionpack/test/fixtures/multipart/single_utf8_param +5 -0
  392. data/vendor/rails/actionpack/test/fixtures/multipart/text_file +10 -0
  393. data/vendor/rails/actionpack/test/fixtures/multipart/utf8_filename +10 -0
  394. data/vendor/rails/actionpack/test/fixtures/namespaced/implicit_render_test/hello_world.erb +1 -0
  395. data/vendor/rails/actionpack/test/fixtures/old_content_type/render_default_content_types_for_respond_to.xml.erb +1 -0
  396. data/vendor/rails/actionpack/test/fixtures/old_content_type/render_default_for_builder.builder +1 -0
  397. data/vendor/rails/actionpack/test/fixtures/old_content_type/render_default_for_erb.erb +1 -0
  398. data/vendor/rails/actionpack/test/fixtures/post_test/layouts/post.html.erb +1 -0
  399. data/vendor/rails/actionpack/test/fixtures/post_test/layouts/super_post.iphone.erb +1 -0
  400. data/vendor/rails/actionpack/test/fixtures/post_test/post/index.html.erb +1 -0
  401. data/vendor/rails/actionpack/test/fixtures/post_test/post/index.iphone.erb +1 -0
  402. data/vendor/rails/actionpack/test/fixtures/post_test/super_post/index.html.erb +1 -0
  403. data/vendor/rails/actionpack/test/fixtures/post_test/super_post/index.iphone.erb +1 -0
  404. data/vendor/rails/actionpack/test/fixtures/public/400.html +1 -0
  405. data/vendor/rails/actionpack/test/fixtures/public/404.html +1 -0
  406. data/vendor/rails/actionpack/test/fixtures/public/500.da.html +1 -0
  407. data/vendor/rails/actionpack/test/fixtures/public/500.html +1 -0
  408. data/vendor/rails/actionpack/test/fixtures/public/bar.html +1 -0
  409. data/vendor/rails/actionpack/test/fixtures/public/bar/index.html +1 -0
  410. data/vendor/rails/actionpack/test/fixtures/public/foo/bar.html +1 -0
  411. data/vendor/rails/actionpack/test/fixtures/public/foo/baz.css +3 -0
  412. data/vendor/rails/actionpack/test/fixtures/public/foo/index.html +1 -0
  413. data/vendor/rails/actionpack/test/fixtures/public/foo/other-index.html +1 -0
  414. data/vendor/rails/actionpack/test/fixtures/public/foo//343/201/223/343/202/223/343/201/253/343/201/241/343/201/257.html +1 -0
  415. data/vendor/rails/actionpack/test/fixtures/public/foo//343/201/225/343/202/210/343/201/206/343/201/252/343/202/211.html +1 -0
  416. data/vendor/rails/actionpack/test/fixtures/public/foo//343/201/225/343/202/210/343/201/206/343/201/252/343/202/211.html.gz +0 -0
  417. data/vendor/rails/actionpack/test/fixtures/public/gzip/application-a71b3024f80aea3181c09774ca17e712.js +4 -0
  418. data/vendor/rails/actionpack/test/fixtures/public/gzip/application-a71b3024f80aea3181c09774ca17e712.js.gz +0 -0
  419. data/vendor/rails/actionpack/test/fixtures/public/gzip/foo.zoo +4 -0
  420. data/vendor/rails/actionpack/test/fixtures/public/gzip/foo.zoo.gz +0 -0
  421. data/vendor/rails/actionpack/test/fixtures/public/index.html +1 -0
  422. data/vendor/rails/actionpack/test/fixtures/public/other-index.html +1 -0
  423. data/vendor/rails/actionpack/test/fixtures/respond_to/all_types_with_layout.html.erb +1 -0
  424. data/vendor/rails/actionpack/test/fixtures/respond_to/custom_constant_handling_without_block.mobile.erb +1 -0
  425. data/vendor/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.html.erb +1 -0
  426. data/vendor/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.iphone.erb +1 -0
  427. data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/missing.html.erb +1 -0
  428. data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.html.erb +1 -0
  429. data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.iphone.erb +1 -0
  430. data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.html.erb +1 -0
  431. data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.xml.builder +1 -0
  432. data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_all.html.erb +1 -0
  433. data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.html.erb +1 -0
  434. data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.xml.builder +1 -0
  435. data/vendor/rails/actionpack/test/fixtures/respond_to/variant_any_implicit_render.html+phablet.erb +1 -0
  436. data/vendor/rails/actionpack/test/fixtures/respond_to/variant_any_implicit_render.html+tablet.erb +1 -0
  437. data/vendor/rails/actionpack/test/fixtures/respond_to/variant_inline_syntax_without_block.html+phone.erb +1 -0
  438. data/vendor/rails/actionpack/test/fixtures/respond_to/variant_plus_none_for_format.html.erb +1 -0
  439. data/vendor/rails/actionpack/test/fixtures/respond_to/variant_with_implicit_template_rendering.html+mobile.erb +1 -0
  440. data/vendor/rails/actionpack/test/fixtures/ruby_template.ruby +2 -0
  441. data/vendor/rails/actionpack/test/fixtures/session_autoload_test/session_autoload_test/foo.rb +12 -0
  442. data/vendor/rails/actionpack/test/fixtures/shared.html.erb +1 -0
  443. data/vendor/rails/actionpack/test/fixtures/star_star_mime/index.js.erb +1 -0
  444. data/vendor/rails/actionpack/test/fixtures/test/_partial.erb +1 -0
  445. data/vendor/rails/actionpack/test/fixtures/test/_partial.html.erb +1 -0
  446. data/vendor/rails/actionpack/test/fixtures/test/_partial.js.erb +1 -0
  447. data/vendor/rails/actionpack/test/fixtures/test/dot.directory/render_file_with_ivar.erb +1 -0
  448. data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.builder +1 -0
  449. data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.html.erb +1 -0
  450. data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.xml.erb +1 -0
  451. data/vendor/rails/actionpack/test/fixtures/test/hello/hello.erb +1 -0
  452. data/vendor/rails/actionpack/test/fixtures/test/hello_world.erb +1 -0
  453. data/vendor/rails/actionpack/test/fixtures/test/hello_world_with_partial.html.erb +2 -0
  454. data/vendor/rails/actionpack/test/fixtures/test/hello_xml_world.builder +11 -0
  455. data/vendor/rails/actionpack/test/fixtures/test/implicit_content_type.atom.builder +2 -0
  456. data/vendor/rails/actionpack/test/fixtures/test/render_file_with_ivar.erb +1 -0
  457. data/vendor/rails/actionpack/test/fixtures/test/render_file_with_locals.erb +1 -0
  458. data/vendor/rails/actionpack/test/fixtures/test/with_implicit_template.erb +1 -0
  459. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/bar.html +1 -0
  460. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/bar/index.html +1 -0
  461. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo/bar.html +1 -0
  462. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo/baz.css +3 -0
  463. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo/index.html +1 -0
  464. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo/other-index.html +1 -0
  465. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo//343/201/223/343/202/223/343/201/253/343/201/241/343/201/257.html +1 -0
  466. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo//343/201/225/343/202/210/343/201/206/343/201/252/343/202/211.html +1 -0
  467. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo//343/201/225/343/202/210/343/201/206/343/201/252/343/202/211.html.gz +0 -0
  468. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/gzip/application-a71b3024f80aea3181c09774ca17e712.js +4 -0
  469. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/gzip/application-a71b3024f80aea3181c09774ca17e712.js.gz +0 -0
  470. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/gzip/foo.zoo +4 -0
  471. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/gzip/foo.zoo.gz +0 -0
  472. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/index.html +1 -0
  473. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/other-index.html +1 -0
  474. data/vendor/rails/actionpack/test/journey/gtg/builder_test.rb +81 -0
  475. data/vendor/rails/actionpack/test/journey/gtg/transition_table_test.rb +125 -0
  476. data/vendor/rails/actionpack/test/journey/nfa/simulator_test.rb +100 -0
  477. data/vendor/rails/actionpack/test/journey/nfa/transition_table_test.rb +74 -0
  478. data/vendor/rails/actionpack/test/journey/nodes/symbol_test.rb +19 -0
  479. data/vendor/rails/actionpack/test/journey/path/pattern_test.rb +286 -0
  480. data/vendor/rails/actionpack/test/journey/route/definition/parser_test.rb +112 -0
  481. data/vendor/rails/actionpack/test/journey/route/definition/scanner_test.rb +71 -0
  482. data/vendor/rails/actionpack/test/journey/route_test.rb +113 -0
  483. data/vendor/rails/actionpack/test/journey/router/utils_test.rb +48 -0
  484. data/vendor/rails/actionpack/test/journey/router_test.rb +544 -0
  485. data/vendor/rails/actionpack/test/journey/routes_test.rb +62 -0
  486. data/vendor/rails/actionpack/test/lib/controller/fake_controllers.rb +37 -0
  487. data/vendor/rails/actionpack/test/lib/controller/fake_models.rb +79 -0
  488. data/vendor/rails/actionpack/test/routing/helper_test.rb +33 -0
  489. data/vendor/rails/actionview/CHANGELOG.md +122 -0
  490. data/vendor/rails/actionview/MIT-LICENSE +21 -0
  491. data/vendor/rails/actionview/README.rdoc +38 -0
  492. data/vendor/rails/actionview/RUNNING_UJS_TESTS.rdoc +8 -0
  493. data/vendor/rails/actionview/RUNNING_UNIT_TESTS.rdoc +26 -0
  494. data/vendor/rails/actionview/Rakefile +136 -0
  495. data/vendor/rails/actionview/actionview.gemspec +38 -0
  496. data/vendor/rails/actionview/app/assets/javascripts/MIT-LICENSE +20 -0
  497. data/vendor/rails/actionview/app/assets/javascripts/README.md +55 -0
  498. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs.coffee +39 -0
  499. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/BANNER.js +5 -0
  500. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/features/confirm.coffee +26 -0
  501. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/features/disable.coffee +82 -0
  502. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/features/method.coffee +34 -0
  503. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/features/remote.coffee +90 -0
  504. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/start.coffee +71 -0
  505. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee +97 -0
  506. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/csp.coffee +4 -0
  507. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/csrf.coffee +25 -0
  508. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/dom.coffee +35 -0
  509. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/event.coffee +68 -0
  510. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/form.coffee +36 -0
  511. data/vendor/rails/actionview/bin/test +5 -0
  512. data/vendor/rails/actionview/blade.yml +11 -0
  513. data/vendor/rails/actionview/coffeelint.json +135 -0
  514. data/vendor/rails/actionview/lib/action_view.rb +97 -0
  515. data/vendor/rails/actionview/lib/action_view/base.rb +215 -0
  516. data/vendor/rails/actionview/lib/action_view/buffers.rb +52 -0
  517. data/vendor/rails/actionview/lib/action_view/context.rb +36 -0
  518. data/vendor/rails/actionview/lib/action_view/dependency_tracker.rb +175 -0
  519. data/vendor/rails/actionview/lib/action_view/digestor.rb +136 -0
  520. data/vendor/rails/actionview/lib/action_view/flows.rb +76 -0
  521. data/vendor/rails/actionview/lib/action_view/gem_version.rb +17 -0
  522. data/vendor/rails/actionview/lib/action_view/helpers.rb +68 -0
  523. data/vendor/rails/actionview/lib/action_view/helpers/active_model_helper.rb +55 -0
  524. data/vendor/rails/actionview/lib/action_view/helpers/asset_tag_helper.rb +511 -0
  525. data/vendor/rails/actionview/lib/action_view/helpers/asset_url_helper.rb +469 -0
  526. data/vendor/rails/actionview/lib/action_view/helpers/atom_feed_helper.rb +205 -0
  527. data/vendor/rails/actionview/lib/action_view/helpers/cache_helper.rb +263 -0
  528. data/vendor/rails/actionview/lib/action_view/helpers/capture_helper.rb +212 -0
  529. data/vendor/rails/actionview/lib/action_view/helpers/controller_helper.rb +36 -0
  530. data/vendor/rails/actionview/lib/action_view/helpers/csp_helper.rb +24 -0
  531. data/vendor/rails/actionview/lib/action_view/helpers/csrf_helper.rb +35 -0
  532. data/vendor/rails/actionview/lib/action_view/helpers/date_helper.rb +1156 -0
  533. data/vendor/rails/actionview/lib/action_view/helpers/debug_helper.rb +36 -0
  534. data/vendor/rails/actionview/lib/action_view/helpers/form_helper.rb +2337 -0
  535. data/vendor/rails/actionview/lib/action_view/helpers/form_options_helper.rb +887 -0
  536. data/vendor/rails/actionview/lib/action_view/helpers/form_tag_helper.rb +917 -0
  537. data/vendor/rails/actionview/lib/action_view/helpers/javascript_helper.rb +94 -0
  538. data/vendor/rails/actionview/lib/action_view/helpers/number_helper.rb +451 -0
  539. data/vendor/rails/actionview/lib/action_view/helpers/output_safety_helper.rb +70 -0
  540. data/vendor/rails/actionview/lib/action_view/helpers/record_tag_helper.rb +23 -0
  541. data/vendor/rails/actionview/lib/action_view/helpers/rendering_helper.rb +99 -0
  542. data/vendor/rails/actionview/lib/action_view/helpers/sanitize_helper.rb +177 -0
  543. data/vendor/rails/actionview/lib/action_view/helpers/tag_helper.rb +313 -0
  544. data/vendor/rails/actionview/lib/action_view/helpers/tags.rb +44 -0
  545. data/vendor/rails/actionview/lib/action_view/helpers/tags/base.rb +192 -0
  546. data/vendor/rails/actionview/lib/action_view/helpers/tags/check_box.rb +66 -0
  547. data/vendor/rails/actionview/lib/action_view/helpers/tags/checkable.rb +18 -0
  548. data/vendor/rails/actionview/lib/action_view/helpers/tags/collection_check_boxes.rb +36 -0
  549. data/vendor/rails/actionview/lib/action_view/helpers/tags/collection_helpers.rb +119 -0
  550. data/vendor/rails/actionview/lib/action_view/helpers/tags/collection_radio_buttons.rb +31 -0
  551. data/vendor/rails/actionview/lib/action_view/helpers/tags/collection_select.rb +30 -0
  552. data/vendor/rails/actionview/lib/action_view/helpers/tags/color_field.rb +27 -0
  553. data/vendor/rails/actionview/lib/action_view/helpers/tags/date_field.rb +15 -0
  554. data/vendor/rails/actionview/lib/action_view/helpers/tags/date_select.rb +74 -0
  555. data/vendor/rails/actionview/lib/action_view/helpers/tags/datetime_field.rb +32 -0
  556. data/vendor/rails/actionview/lib/action_view/helpers/tags/datetime_local_field.rb +21 -0
  557. data/vendor/rails/actionview/lib/action_view/helpers/tags/datetime_select.rb +10 -0
  558. data/vendor/rails/actionview/lib/action_view/helpers/tags/email_field.rb +10 -0
  559. data/vendor/rails/actionview/lib/action_view/helpers/tags/file_field.rb +10 -0
  560. data/vendor/rails/actionview/lib/action_view/helpers/tags/grouped_collection_select.rb +31 -0
  561. data/vendor/rails/actionview/lib/action_view/helpers/tags/hidden_field.rb +10 -0
  562. data/vendor/rails/actionview/lib/action_view/helpers/tags/label.rb +81 -0
  563. data/vendor/rails/actionview/lib/action_view/helpers/tags/month_field.rb +15 -0
  564. data/vendor/rails/actionview/lib/action_view/helpers/tags/number_field.rb +20 -0
  565. data/vendor/rails/actionview/lib/action_view/helpers/tags/password_field.rb +14 -0
  566. data/vendor/rails/actionview/lib/action_view/helpers/tags/placeholderable.rb +24 -0
  567. data/vendor/rails/actionview/lib/action_view/helpers/tags/radio_button.rb +33 -0
  568. data/vendor/rails/actionview/lib/action_view/helpers/tags/range_field.rb +10 -0
  569. data/vendor/rails/actionview/lib/action_view/helpers/tags/search_field.rb +27 -0
  570. data/vendor/rails/actionview/lib/action_view/helpers/tags/select.rb +43 -0
  571. data/vendor/rails/actionview/lib/action_view/helpers/tags/tel_field.rb +10 -0
  572. data/vendor/rails/actionview/lib/action_view/helpers/tags/text_area.rb +24 -0
  573. data/vendor/rails/actionview/lib/action_view/helpers/tags/text_field.rb +34 -0
  574. data/vendor/rails/actionview/lib/action_view/helpers/tags/time_field.rb +15 -0
  575. data/vendor/rails/actionview/lib/action_view/helpers/tags/time_select.rb +10 -0
  576. data/vendor/rails/actionview/lib/action_view/helpers/tags/time_zone_select.rb +22 -0
  577. data/vendor/rails/actionview/lib/action_view/helpers/tags/translator.rb +44 -0
  578. data/vendor/rails/actionview/lib/action_view/helpers/tags/url_field.rb +10 -0
  579. data/vendor/rails/actionview/lib/action_view/helpers/tags/week_field.rb +15 -0
  580. data/vendor/rails/actionview/lib/action_view/helpers/text_helper.rb +486 -0
  581. data/vendor/rails/actionview/lib/action_view/helpers/translation_helper.rb +141 -0
  582. data/vendor/rails/actionview/lib/action_view/helpers/url_helper.rb +676 -0
  583. data/vendor/rails/actionview/lib/action_view/layouts.rb +433 -0
  584. data/vendor/rails/actionview/lib/action_view/locale/en.yml +56 -0
  585. data/vendor/rails/actionview/lib/action_view/log_subscriber.rb +96 -0
  586. data/vendor/rails/actionview/lib/action_view/lookup_context.rb +274 -0
  587. data/vendor/rails/actionview/lib/action_view/model_naming.rb +14 -0
  588. data/vendor/rails/actionview/lib/action_view/path_set.rb +100 -0
  589. data/vendor/rails/actionview/lib/action_view/railtie.rb +82 -0
  590. data/vendor/rails/actionview/lib/action_view/record_identifier.rb +112 -0
  591. data/vendor/rails/actionview/lib/action_view/renderer/abstract_renderer.rb +55 -0
  592. data/vendor/rails/actionview/lib/action_view/renderer/partial_renderer.rb +552 -0
  593. data/vendor/rails/actionview/lib/action_view/renderer/partial_renderer/collection_caching.rb +57 -0
  594. data/vendor/rails/actionview/lib/action_view/renderer/renderer.rb +56 -0
  595. data/vendor/rails/actionview/lib/action_view/renderer/streaming_template_renderer.rb +105 -0
  596. data/vendor/rails/actionview/lib/action_view/renderer/template_renderer.rb +102 -0
  597. data/vendor/rails/actionview/lib/action_view/rendering.rb +151 -0
  598. data/vendor/rails/actionview/lib/action_view/routing_url_for.rb +145 -0
  599. data/vendor/rails/actionview/lib/action_view/tasks/cache_digests.rake +25 -0
  600. data/vendor/rails/actionview/lib/action_view/template.rb +361 -0
  601. data/vendor/rails/actionview/lib/action_view/template/error.rb +141 -0
  602. data/vendor/rails/actionview/lib/action_view/template/handlers.rb +66 -0
  603. data/vendor/rails/actionview/lib/action_view/template/handlers/builder.rb +25 -0
  604. data/vendor/rails/actionview/lib/action_view/template/handlers/erb.rb +74 -0
  605. data/vendor/rails/actionview/lib/action_view/template/handlers/erb/erubi.rb +83 -0
  606. data/vendor/rails/actionview/lib/action_view/template/handlers/html.rb +11 -0
  607. data/vendor/rails/actionview/lib/action_view/template/handlers/raw.rb +11 -0
  608. data/vendor/rails/actionview/lib/action_view/template/html.rb +34 -0
  609. data/vendor/rails/actionview/lib/action_view/template/resolver.rb +391 -0
  610. data/vendor/rails/actionview/lib/action_view/template/text.rb +33 -0
  611. data/vendor/rails/actionview/lib/action_view/template/types.rb +57 -0
  612. data/vendor/rails/actionview/lib/action_view/test_case.rb +300 -0
  613. data/vendor/rails/actionview/lib/action_view/testing/resolvers.rb +54 -0
  614. data/vendor/rails/actionview/lib/action_view/version.rb +10 -0
  615. data/vendor/rails/actionview/lib/action_view/view_paths.rb +105 -0
  616. data/vendor/rails/actionview/package.json +36 -0
  617. data/vendor/rails/actionview/test/abstract_unit.rb +236 -0
  618. data/vendor/rails/actionview/test/actionpack/abstract/abstract_controller_test.rb +292 -0
  619. data/vendor/rails/actionview/test/actionpack/abstract/helper_test.rb +128 -0
  620. data/vendor/rails/actionview/test/actionpack/abstract/layouts_test.rb +568 -0
  621. data/vendor/rails/actionview/test/actionpack/abstract/render_test.rb +103 -0
  622. data/vendor/rails/actionview/test/actionpack/abstract/views/abstract_controller/testing/me3/formatted.html.erb +1 -0
  623. data/vendor/rails/actionview/test/actionpack/abstract/views/abstract_controller/testing/me3/index.erb +1 -0
  624. data/vendor/rails/actionview/test/actionpack/abstract/views/abstract_controller/testing/me4/index.erb +1 -0
  625. data/vendor/rails/actionview/test/actionpack/abstract/views/action_with_ivars.erb +1 -0
  626. data/vendor/rails/actionview/test/actionpack/abstract/views/helper_test.erb +1 -0
  627. data/vendor/rails/actionview/test/actionpack/abstract/views/index.erb +1 -0
  628. data/vendor/rails/actionview/test/actionpack/abstract/views/layouts/abstract_controller/testing/me4.erb +1 -0
  629. data/vendor/rails/actionview/test/actionpack/abstract/views/layouts/application.erb +1 -0
  630. data/vendor/rails/actionview/test/actionpack/abstract/views/naked_render.erb +1 -0
  631. data/vendor/rails/actionview/test/actionpack/controller/capture_test.rb +83 -0
  632. data/vendor/rails/actionview/test/actionpack/controller/layout_test.rb +270 -0
  633. data/vendor/rails/actionview/test/actionpack/controller/render_test.rb +1294 -0
  634. data/vendor/rails/actionview/test/actionpack/controller/view_paths_test.rb +174 -0
  635. data/vendor/rails/actionview/test/active_record_unit.rb +92 -0
  636. data/vendor/rails/actionview/test/activerecord/controller_runtime_test.rb +95 -0
  637. data/vendor/rails/actionview/test/activerecord/debug_helper_test.rb +19 -0
  638. data/vendor/rails/actionview/test/activerecord/form_helper_activerecord_test.rb +90 -0
  639. data/vendor/rails/actionview/test/activerecord/polymorphic_routes_test.rb +780 -0
  640. data/vendor/rails/actionview/test/activerecord/relation_cache_test.rb +23 -0
  641. data/vendor/rails/actionview/test/activerecord/render_partial_with_record_identification_test.rb +188 -0
  642. data/vendor/rails/actionview/test/fixtures/_top_level_partial.html.erb +1 -0
  643. data/vendor/rails/actionview/test/fixtures/_top_level_partial_only.erb +1 -0
  644. data/vendor/rails/actionview/test/fixtures/actionpack/bad_customers/_bad_customer.html.erb +1 -0
  645. data/vendor/rails/actionview/test/fixtures/actionpack/customers/_customer.html.erb +1 -0
  646. data/vendor/rails/actionview/test/fixtures/actionpack/fun/games/_form.erb +1 -0
  647. data/vendor/rails/actionview/test/fixtures/actionpack/fun/games/hello_world.erb +1 -0
  648. data/vendor/rails/actionview/test/fixtures/actionpack/good_customers/_good_customer.html.erb +1 -0
  649. data/vendor/rails/actionview/test/fixtures/actionpack/hello.html +1 -0
  650. data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/alt/layouts/alt.erb +1 -0
  651. data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/controller_name_space/nested.erb +1 -0
  652. data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/item.erb +1 -0
  653. data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/layout_test.erb +1 -0
  654. data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/multiple_extensions.html.erb +1 -0
  655. data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/symlinked/symlinked_layout.erb +5 -0
  656. data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/third_party_template_library.mab +1 -0
  657. data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/views/goodbye.erb +1 -0
  658. data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/views/hello.erb +1 -0
  659. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_column.html.erb +2 -0
  660. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_customers.erb +1 -0
  661. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_partial_and_yield.erb +2 -0
  662. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_yield_only.erb +1 -0
  663. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_yield_with_params.erb +1 -0
  664. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/block_with_layout.erb +3 -0
  665. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/builder.builder +3 -0
  666. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/partial_with_layout.erb +3 -0
  667. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/standard.html.erb +1 -0
  668. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/standard.text.erb +1 -0
  669. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/streaming.erb +4 -0
  670. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/talk_from_action.erb +2 -0
  671. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/with_html_partial.html.erb +1 -0
  672. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/xhr.html.erb +2 -0
  673. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/yield.erb +2 -0
  674. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/yield_with_render_inline_inside.erb +2 -0
  675. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/yield_with_render_partial_inside.erb +2 -0
  676. data/vendor/rails/actionview/test/fixtures/actionpack/quiz/questions/_question.html.erb +1 -0
  677. data/vendor/rails/actionview/test/fixtures/actionpack/shared.html.erb +1 -0
  678. data/vendor/rails/actionview/test/fixtures/actionpack/test/_changing_priority.html.erb +1 -0
  679. data/vendor/rails/actionview/test/fixtures/actionpack/test/_changing_priority.json.erb +1 -0
  680. data/vendor/rails/actionview/test/fixtures/actionpack/test/_counter.html.erb +1 -0
  681. data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer.erb +1 -0
  682. data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_counter.erb +1 -0
  683. data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_counter_with_as.erb +1 -0
  684. data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_greeting.erb +1 -0
  685. data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_iteration.erb +1 -0
  686. data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_iteration_with_as.erb +1 -0
  687. data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_with_var.erb +1 -0
  688. data/vendor/rails/actionview/test/fixtures/actionpack/test/_directory/_partial_with_locales.html.erb +1 -0
  689. data/vendor/rails/actionview/test/fixtures/actionpack/test/_first_json_partial.json.erb +1 -0
  690. data/vendor/rails/actionview/test/fixtures/actionpack/test/_form.erb +1 -0
  691. data/vendor/rails/actionview/test/fixtures/actionpack/test/_hash_greeting.erb +1 -0
  692. data/vendor/rails/actionview/test/fixtures/actionpack/test/_hash_object.erb +2 -0
  693. data/vendor/rails/actionview/test/fixtures/actionpack/test/_hello.builder +1 -0
  694. data/vendor/rails/actionview/test/fixtures/actionpack/test/_json_change_priority.json.erb +0 -0
  695. data/vendor/rails/actionview/test/fixtures/actionpack/test/_labelling_form.erb +1 -0
  696. data/vendor/rails/actionview/test/fixtures/actionpack/test/_layout_for_partial.html.erb +3 -0
  697. data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial.erb +1 -0
  698. data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial.html.erb +1 -0
  699. data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial.js.erb +1 -0
  700. data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_for_use_in_layout.html.erb +1 -0
  701. data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_html_erb.html.erb +1 -0
  702. data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_name_local_variable.erb +1 -0
  703. data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_only.erb +1 -0
  704. data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_only_html.html +1 -0
  705. data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_with_partial.erb +2 -0
  706. data/vendor/rails/actionview/test/fixtures/actionpack/test/_person.erb +2 -0
  707. data/vendor/rails/actionview/test/fixtures/actionpack/test/_raise_indentation.html.erb +13 -0
  708. data/vendor/rails/actionview/test/fixtures/actionpack/test/_second_json_partial.json.erb +1 -0
  709. data/vendor/rails/actionview/test/fixtures/actionpack/test/action_talk_to_layout.erb +2 -0
  710. data/vendor/rails/actionview/test/fixtures/actionpack/test/calling_partial_with_layout.html.erb +1 -0
  711. data/vendor/rails/actionview/test/fixtures/actionpack/test/capturing.erb +4 -0
  712. data/vendor/rails/actionview/test/fixtures/actionpack/test/change_priority.html.erb +2 -0
  713. data/vendor/rails/actionview/test/fixtures/actionpack/test/content_for.erb +1 -0
  714. data/vendor/rails/actionview/test/fixtures/actionpack/test/content_for_concatenated.erb +3 -0
  715. data/vendor/rails/actionview/test/fixtures/actionpack/test/content_for_with_parameter.erb +2 -0
  716. data/vendor/rails/actionview/test/fixtures/actionpack/test/dot.directory/render_file_with_ivar.erb +1 -0
  717. data/vendor/rails/actionview/test/fixtures/actionpack/test/formatted_html_erb.html.erb +1 -0
  718. data/vendor/rails/actionview/test/fixtures/actionpack/test/formatted_xml_erb.builder +1 -0
  719. data/vendor/rails/actionview/test/fixtures/actionpack/test/formatted_xml_erb.html.erb +1 -0
  720. data/vendor/rails/actionview/test/fixtures/actionpack/test/formatted_xml_erb.xml.erb +1 -0
  721. data/vendor/rails/actionview/test/fixtures/actionpack/test/greeting.html.erb +1 -0
  722. data/vendor/rails/actionview/test/fixtures/actionpack/test/greeting.xml.erb +1 -0
  723. data/vendor/rails/actionview/test/fixtures/actionpack/test/hello,world.erb +1 -0
  724. data/vendor/rails/actionview/test/fixtures/actionpack/test/hello.builder +4 -0
  725. data/vendor/rails/actionview/test/fixtures/actionpack/test/hello/hello.erb +1 -0
  726. data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world.erb +1 -0
  727. data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world_container.builder +3 -0
  728. data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world_from_rxml.builder +3 -0
  729. data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world_with_layout_false.erb +1 -0
  730. data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world_with_partial.html.erb +2 -0
  731. data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_xml_world.builder +11 -0
  732. data/vendor/rails/actionview/test/fixtures/actionpack/test/html_template.html.erb +1 -0
  733. data/vendor/rails/actionview/test/fixtures/actionpack/test/hyphen-ated.erb +1 -0
  734. data/vendor/rails/actionview/test/fixtures/actionpack/test/implicit_content_type.atom.builder +2 -0
  735. data/vendor/rails/actionview/test/fixtures/actionpack/test/list.erb +1 -0
  736. data/vendor/rails/actionview/test/fixtures/actionpack/test/non_erb_block_content_for.builder +4 -0
  737. data/vendor/rails/actionview/test/fixtures/actionpack/test/potential_conflicts.erb +4 -0
  738. data/vendor/rails/actionview/test/fixtures/actionpack/test/proper_block_detection.erb +1 -0
  739. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_file_from_template.html.erb +1 -0
  740. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_file_with_ivar.erb +1 -0
  741. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_file_with_locals.erb +1 -0
  742. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_file_with_locals_and_default.erb +1 -0
  743. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_implicit_html_template_from_xhr_request.da.html.erb +1 -0
  744. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_implicit_html_template_from_xhr_request.html.erb +1 -0
  745. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_implicit_js_template_without_layout.js.erb +1 -0
  746. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_partial_inside_directory.html.erb +1 -0
  747. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_to_string_test.erb +1 -0
  748. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_two_partials.html.erb +2 -0
  749. data/vendor/rails/actionview/test/fixtures/actionpack/test/using_layout_around_block.html.erb +1 -0
  750. data/vendor/rails/actionview/test/fixtures/actionpack/test/with_html_partial.html.erb +1 -0
  751. data/vendor/rails/actionview/test/fixtures/actionpack/test/with_partial.html.erb +1 -0
  752. data/vendor/rails/actionview/test/fixtures/actionpack/test/with_partial.text.erb +1 -0
  753. data/vendor/rails/actionview/test/fixtures/actionpack/test/with_xml_template.html.erb +1 -0
  754. data/vendor/rails/actionview/test/fixtures/comments/empty.de.html.erb +1 -0
  755. data/vendor/rails/actionview/test/fixtures/comments/empty.html+grid.erb +1 -0
  756. data/vendor/rails/actionview/test/fixtures/comments/empty.html.builder +1 -0
  757. data/vendor/rails/actionview/test/fixtures/comments/empty.html.erb +1 -0
  758. data/vendor/rails/actionview/test/fixtures/comments/empty.xml.erb +1 -0
  759. data/vendor/rails/actionview/test/fixtures/companies.yml +24 -0
  760. data/vendor/rails/actionview/test/fixtures/company.rb +11 -0
  761. data/vendor/rails/actionview/test/fixtures/custom_pattern/another.html.erb +1 -0
  762. data/vendor/rails/actionview/test/fixtures/custom_pattern/html/another.erb +1 -0
  763. data/vendor/rails/actionview/test/fixtures/custom_pattern/html/path.erb +1 -0
  764. data/vendor/rails/actionview/test/fixtures/customers/_customer.html.erb +1 -0
  765. data/vendor/rails/actionview/test/fixtures/customers/_customer.xml.erb +1 -0
  766. data/vendor/rails/actionview/test/fixtures/db_definitions/sqlite.sql +49 -0
  767. data/vendor/rails/actionview/test/fixtures/developer.rb +8 -0
  768. data/vendor/rails/actionview/test/fixtures/developers.yml +21 -0
  769. data/vendor/rails/actionview/test/fixtures/developers/_developer.erb +1 -0
  770. data/vendor/rails/actionview/test/fixtures/developers_projects.yml +13 -0
  771. data/vendor/rails/actionview/test/fixtures/digestor/api/comments/_comment.json.erb +1 -0
  772. data/vendor/rails/actionview/test/fixtures/digestor/api/comments/_comments.json.erb +1 -0
  773. data/vendor/rails/actionview/test/fixtures/digestor/comments/_comment.html.erb +1 -0
  774. data/vendor/rails/actionview/test/fixtures/digestor/comments/_comments.html.erb +1 -0
  775. data/vendor/rails/actionview/test/fixtures/digestor/comments/show.js.erb +1 -0
  776. data/vendor/rails/actionview/test/fixtures/digestor/events/_completed.html.erb +0 -0
  777. data/vendor/rails/actionview/test/fixtures/digestor/events/_event.html.erb +0 -0
  778. data/vendor/rails/actionview/test/fixtures/digestor/events/index.html.erb +1 -0
  779. data/vendor/rails/actionview/test/fixtures/digestor/level/_recursion.html.erb +1 -0
  780. data/vendor/rails/actionview/test/fixtures/digestor/level/below/_header.html.erb +0 -0
  781. data/vendor/rails/actionview/test/fixtures/digestor/level/below/index.html.erb +1 -0
  782. data/vendor/rails/actionview/test/fixtures/digestor/level/recursion.html.erb +1 -0
  783. data/vendor/rails/actionview/test/fixtures/digestor/messages/_form.html.erb +0 -0
  784. data/vendor/rails/actionview/test/fixtures/digestor/messages/_header.html.erb +0 -0
  785. data/vendor/rails/actionview/test/fixtures/digestor/messages/_message.html.erb +1 -0
  786. data/vendor/rails/actionview/test/fixtures/digestor/messages/actions/_move.html.erb +0 -0
  787. data/vendor/rails/actionview/test/fixtures/digestor/messages/edit.html.erb +5 -0
  788. data/vendor/rails/actionview/test/fixtures/digestor/messages/index.html.erb +2 -0
  789. data/vendor/rails/actionview/test/fixtures/digestor/messages/new.html+iphone.erb +15 -0
  790. data/vendor/rails/actionview/test/fixtures/digestor/messages/peek.html.erb +2 -0
  791. data/vendor/rails/actionview/test/fixtures/digestor/messages/show.html.erb +14 -0
  792. data/vendor/rails/actionview/test/fixtures/digestor/messages/thread.json.erb +1 -0
  793. data/vendor/rails/actionview/test/fixtures/fun/games/_game.erb +1 -0
  794. data/vendor/rails/actionview/test/fixtures/fun/games/hello_world.erb +1 -0
  795. data/vendor/rails/actionview/test/fixtures/fun/serious/games/_game.erb +1 -0
  796. data/vendor/rails/actionview/test/fixtures/games/_game.erb +1 -0
  797. data/vendor/rails/actionview/test/fixtures/good_customers/_good_customer.html.erb +1 -0
  798. data/vendor/rails/actionview/test/fixtures/helpers/abc_helper.rb +5 -0
  799. data/vendor/rails/actionview/test/fixtures/helpers/helpery_test_helper.rb +7 -0
  800. data/vendor/rails/actionview/test/fixtures/helpers_missing/invalid_require_helper.rb +6 -0
  801. data/vendor/rails/actionview/test/fixtures/layout_tests/alt/hello.erb +1 -0
  802. data/vendor/rails/actionview/test/fixtures/layouts/_column.html.erb +2 -0
  803. data/vendor/rails/actionview/test/fixtures/layouts/_customers.erb +1 -0
  804. data/vendor/rails/actionview/test/fixtures/layouts/_partial_and_yield.erb +2 -0
  805. data/vendor/rails/actionview/test/fixtures/layouts/_yield_only.erb +1 -0
  806. data/vendor/rails/actionview/test/fixtures/layouts/_yield_with_params.erb +1 -0
  807. data/vendor/rails/actionview/test/fixtures/layouts/render_partial_html.erb +2 -0
  808. data/vendor/rails/actionview/test/fixtures/layouts/streaming.erb +4 -0
  809. data/vendor/rails/actionview/test/fixtures/layouts/streaming_with_capture.erb +6 -0
  810. data/vendor/rails/actionview/test/fixtures/layouts/streaming_with_locale.erb +2 -0
  811. data/vendor/rails/actionview/test/fixtures/layouts/yield.erb +2 -0
  812. data/vendor/rails/actionview/test/fixtures/layouts/yield_with_render_inline_inside.erb +2 -0
  813. data/vendor/rails/actionview/test/fixtures/layouts/yield_with_render_partial_inside.erb +2 -0
  814. data/vendor/rails/actionview/test/fixtures/mascot.rb +5 -0
  815. data/vendor/rails/actionview/test/fixtures/mascots.yml +4 -0
  816. data/vendor/rails/actionview/test/fixtures/mascots/_mascot.html.erb +1 -0
  817. data/vendor/rails/actionview/test/fixtures/override/test/hello_world.erb +1 -0
  818. data/vendor/rails/actionview/test/fixtures/override2/layouts/test/sub.erb +1 -0
  819. data/vendor/rails/actionview/test/fixtures/plain_text.raw +1 -0
  820. data/vendor/rails/actionview/test/fixtures/plain_text_with_characters.raw +1 -0
  821. data/vendor/rails/actionview/test/fixtures/project.rb +9 -0
  822. data/vendor/rails/actionview/test/fixtures/projects.yml +7 -0
  823. data/vendor/rails/actionview/test/fixtures/projects/_project.erb +1 -0
  824. data/vendor/rails/actionview/test/fixtures/public/elsewhere/cools.js +1 -0
  825. data/vendor/rails/actionview/test/fixtures/public/elsewhere/file.css +1 -0
  826. data/vendor/rails/actionview/test/fixtures/public/foo/baz.css +3 -0
  827. data/vendor/rails/actionview/test/fixtures/public/javascripts/application.js +1 -0
  828. data/vendor/rails/actionview/test/fixtures/public/javascripts/bank.js +1 -0
  829. data/vendor/rails/actionview/test/fixtures/public/javascripts/common.javascript +1 -0
  830. data/vendor/rails/actionview/test/fixtures/public/javascripts/controls.js +1 -0
  831. data/vendor/rails/actionview/test/fixtures/public/javascripts/dragdrop.js +1 -0
  832. data/vendor/rails/actionview/test/fixtures/public/javascripts/effects.js +1 -0
  833. data/vendor/rails/actionview/test/fixtures/public/javascripts/prototype.js +1 -0
  834. data/vendor/rails/actionview/test/fixtures/public/javascripts/robber.js +1 -0
  835. data/vendor/rails/actionview/test/fixtures/public/javascripts/subdir/subdir.js +1 -0
  836. data/vendor/rails/actionview/test/fixtures/public/javascripts/version.1.0.js +1 -0
  837. data/vendor/rails/actionview/test/fixtures/public/stylesheets/bank.css +1 -0
  838. data/vendor/rails/actionview/test/fixtures/public/stylesheets/random.styles +1 -0
  839. data/vendor/rails/actionview/test/fixtures/public/stylesheets/robber.css +1 -0
  840. data/vendor/rails/actionview/test/fixtures/public/stylesheets/subdir/subdir.css +1 -0
  841. data/vendor/rails/actionview/test/fixtures/public/stylesheets/version.1.0.css +1 -0
  842. data/vendor/rails/actionview/test/fixtures/replies.yml +15 -0
  843. data/vendor/rails/actionview/test/fixtures/replies/_reply.erb +1 -0
  844. data/vendor/rails/actionview/test/fixtures/reply.rb +9 -0
  845. data/vendor/rails/actionview/test/fixtures/respond_to/using_defaults_with_all.html.erb +1 -0
  846. data/vendor/rails/actionview/test/fixtures/ruby_template.ruby +2 -0
  847. data/vendor/rails/actionview/test/fixtures/shared.html.erb +1 -0
  848. data/vendor/rails/actionview/test/fixtures/test/_200.html.erb +1 -0
  849. data/vendor/rails/actionview/test/fixtures/test/_FooBar.html.erb +1 -0
  850. data/vendor/rails/actionview/test/fixtures/test/_a-in.html.erb +0 -0
  851. data/vendor/rails/actionview/test/fixtures/test/_b_layout_for_partial.html.erb +1 -0
  852. data/vendor/rails/actionview/test/fixtures/test/_b_layout_for_partial_with_object.html.erb +1 -0
  853. data/vendor/rails/actionview/test/fixtures/test/_b_layout_for_partial_with_object_counter.html.erb +1 -0
  854. data/vendor/rails/actionview/test/fixtures/test/_builder_tag_nested_in_content_tag.erb +3 -0
  855. data/vendor/rails/actionview/test/fixtures/test/_cached_customer.erb +3 -0
  856. data/vendor/rails/actionview/test/fixtures/test/_cached_customer_as.erb +3 -0
  857. data/vendor/rails/actionview/test/fixtures/test/_cached_nested_cached_customer.erb +3 -0
  858. data/vendor/rails/actionview/test/fixtures/test/_changing_priority.html.erb +1 -0
  859. data/vendor/rails/actionview/test/fixtures/test/_changing_priority.json.erb +1 -0
  860. data/vendor/rails/actionview/test/fixtures/test/_content_tag_nested_in_content_tag.erb +3 -0
  861. data/vendor/rails/actionview/test/fixtures/test/_counter.html.erb +1 -0
  862. data/vendor/rails/actionview/test/fixtures/test/_customer.erb +1 -0
  863. data/vendor/rails/actionview/test/fixtures/test/_customer.mobile.erb +1 -0
  864. data/vendor/rails/actionview/test/fixtures/test/_customer_greeting.erb +1 -0
  865. data/vendor/rails/actionview/test/fixtures/test/_customer_with_var.erb +1 -0
  866. data/vendor/rails/actionview/test/fixtures/test/_directory/_partial_with_locales.html.erb +1 -0
  867. data/vendor/rails/actionview/test/fixtures/test/_first_json_partial.json.erb +1 -0
  868. data/vendor/rails/actionview/test/fixtures/test/_from_helper.erb +1 -0
  869. data/vendor/rails/actionview/test/fixtures/test/_json_change_priority.json.erb +0 -0
  870. data/vendor/rails/actionview/test/fixtures/test/_klass.erb +1 -0
  871. data/vendor/rails/actionview/test/fixtures/test/_label_with_block.erb +4 -0
  872. data/vendor/rails/actionview/test/fixtures/test/_layout_for_block_with_args.html.erb +3 -0
  873. data/vendor/rails/actionview/test/fixtures/test/_layout_for_partial.html.erb +3 -0
  874. data/vendor/rails/actionview/test/fixtures/test/_layout_with_partial_and_yield.html.erb +4 -0
  875. data/vendor/rails/actionview/test/fixtures/test/_local_inspector.html.erb +1 -0
  876. data/vendor/rails/actionview/test/fixtures/test/_nested_cached_customer.erb +1 -0
  877. data/vendor/rails/actionview/test/fixtures/test/_object_inspector.erb +1 -0
  878. data/vendor/rails/actionview/test/fixtures/test/_one.html.erb +1 -0
  879. data/vendor/rails/actionview/test/fixtures/test/_partial.erb +1 -0
  880. data/vendor/rails/actionview/test/fixtures/test/_partial.html.erb +1 -0
  881. data/vendor/rails/actionview/test/fixtures/test/_partial.js.erb +1 -0
  882. data/vendor/rails/actionview/test/fixtures/test/_partial_for_use_in_layout.html.erb +1 -0
  883. data/vendor/rails/actionview/test/fixtures/test/_partial_iteration_1.erb +1 -0
  884. data/vendor/rails/actionview/test/fixtures/test/_partial_iteration_2.erb +1 -0
  885. data/vendor/rails/actionview/test/fixtures/test/_partial_name_in_local_assigns.erb +1 -0
  886. data/vendor/rails/actionview/test/fixtures/test/_partial_name_local_variable.erb +1 -0
  887. data/vendor/rails/actionview/test/fixtures/test/_partial_only.erb +1 -0
  888. data/vendor/rails/actionview/test/fixtures/test/_partial_shortcut_with_block_content.html.erb +3 -0
  889. data/vendor/rails/actionview/test/fixtures/test/_partial_with_layout.erb +2 -0
  890. data/vendor/rails/actionview/test/fixtures/test/_partial_with_layout_block_content.erb +4 -0
  891. data/vendor/rails/actionview/test/fixtures/test/_partial_with_layout_block_partial.erb +4 -0
  892. data/vendor/rails/actionview/test/fixtures/test/_partial_with_only_html_version.html.erb +1 -0
  893. data/vendor/rails/actionview/test/fixtures/test/_partial_with_partial.erb +2 -0
  894. data/vendor/rails/actionview/test/fixtures/test/_partial_with_variants.html+grid.erb +1 -0
  895. data/vendor/rails/actionview/test/fixtures/test/_partialhtml.html +1 -0
  896. data/vendor/rails/actionview/test/fixtures/test/_raise.html.erb +1 -0
  897. data/vendor/rails/actionview/test/fixtures/test/_raise_indentation.html.erb +13 -0
  898. data/vendor/rails/actionview/test/fixtures/test/_second_json_partial.json.erb +1 -0
  899. data/vendor/rails/actionview/test/fixtures/test/_two.html.erb +1 -0
  900. data/vendor/rails/actionview/test/fixtures/test/_utf8_partial.html.erb +1 -0
  901. data/vendor/rails/actionview/test/fixtures/test/_utf8_partial_magic.html.erb +2 -0
  902. data/vendor/rails/actionview/test/fixtures/test/_/360/237/215/243.erb +1 -0
  903. data/vendor/rails/actionview/test/fixtures/test/basic.html.erb +1 -0
  904. data/vendor/rails/actionview/test/fixtures/test/calling_partial_with_layout.html.erb +1 -0
  905. data/vendor/rails/actionview/test/fixtures/test/change_priority.html.erb +2 -0
  906. data/vendor/rails/actionview/test/fixtures/test/dont_pick_me +1 -0
  907. data/vendor/rails/actionview/test/fixtures/test/dot.directory/render_file_with_ivar.erb +1 -0
  908. data/vendor/rails/actionview/test/fixtures/test/greeting.xml.erb +1 -0
  909. data/vendor/rails/actionview/test/fixtures/test/hello.builder +4 -0
  910. data/vendor/rails/actionview/test/fixtures/test/hello/hello.erb +1 -0
  911. data/vendor/rails/actionview/test/fixtures/test/hello_world.da.html.erb +1 -0
  912. data/vendor/rails/actionview/test/fixtures/test/hello_world.erb +1 -0
  913. data/vendor/rails/actionview/test/fixtures/test/hello_world.erb~ +1 -0
  914. data/vendor/rails/actionview/test/fixtures/test/hello_world.html+phone.erb +1 -0
  915. data/vendor/rails/actionview/test/fixtures/test/hello_world.pt-BR.html.erb +1 -0
  916. data/vendor/rails/actionview/test/fixtures/test/hello_world.text+phone.erb +1 -0
  917. data/vendor/rails/actionview/test/fixtures/test/hello_world_with_partial.html.erb +2 -0
  918. data/vendor/rails/actionview/test/fixtures/test/html_template.html.erb +1 -0
  919. data/vendor/rails/actionview/test/fixtures/test/layout_render_file.erb +2 -0
  920. data/vendor/rails/actionview/test/fixtures/test/layout_render_object.erb +1 -0
  921. data/vendor/rails/actionview/test/fixtures/test/list.erb +1 -0
  922. data/vendor/rails/actionview/test/fixtures/test/malformed/malformed.en.html.erb~ +1 -0
  923. data/vendor/rails/actionview/test/fixtures/test/malformed/malformed.erb~ +1 -0
  924. data/vendor/rails/actionview/test/fixtures/test/malformed/malformed.html.erb~ +1 -0
  925. data/vendor/rails/actionview/test/fixtures/test/malformed/malformed~ +1 -0
  926. data/vendor/rails/actionview/test/fixtures/test/nested_layout.erb +3 -0
  927. data/vendor/rails/actionview/test/fixtures/test/nested_streaming.erb +3 -0
  928. data/vendor/rails/actionview/test/fixtures/test/nil_return.erb +1 -0
  929. data/vendor/rails/actionview/test/fixtures/test/one.html.erb +1 -0
  930. data/vendor/rails/actionview/test/fixtures/test/render_file_inspect_local_assigns.erb +1 -0
  931. data/vendor/rails/actionview/test/fixtures/test/render_file_instance_variable.erb +1 -0
  932. data/vendor/rails/actionview/test/fixtures/test/render_file_unicode_local.erb +1 -0
  933. data/vendor/rails/actionview/test/fixtures/test/render_file_with_ivar.erb +1 -0
  934. data/vendor/rails/actionview/test/fixtures/test/render_file_with_locals.erb +1 -0
  935. data/vendor/rails/actionview/test/fixtures/test/render_file_with_locals_and_default.erb +1 -0
  936. data/vendor/rails/actionview/test/fixtures/test/render_file_with_ruby_keyword_locals.erb +1 -0
  937. data/vendor/rails/actionview/test/fixtures/test/render_partial_inside_directory.html.erb +1 -0
  938. data/vendor/rails/actionview/test/fixtures/test/render_two_partials.html.erb +2 -0
  939. data/vendor/rails/actionview/test/fixtures/test/streaming.erb +3 -0
  940. data/vendor/rails/actionview/test/fixtures/test/streaming_buster.erb +3 -0
  941. data/vendor/rails/actionview/test/fixtures/test/streaming_with_locale.erb +1 -0
  942. data/vendor/rails/actionview/test/fixtures/test/sub_template_raise.html.erb +1 -0
  943. data/vendor/rails/actionview/test/fixtures/test/template.erb +1 -0
  944. data/vendor/rails/actionview/test/fixtures/test/test_template_with_delegation_reserved_keywords.erb +1 -0
  945. data/vendor/rails/actionview/test/fixtures/test/update_element_with_capture.erb +9 -0
  946. data/vendor/rails/actionview/test/fixtures/test/utf8.html.erb +4 -0
  947. data/vendor/rails/actionview/test/fixtures/test/utf8_magic.html.erb +5 -0
  948. data/vendor/rails/actionview/test/fixtures/test/utf8_magic_with_bare_partial.html.erb +5 -0
  949. data/vendor/rails/actionview/test/fixtures/topic.rb +5 -0
  950. data/vendor/rails/actionview/test/fixtures/topics.yml +22 -0
  951. data/vendor/rails/actionview/test/fixtures/topics/_topic.html.erb +1 -0
  952. data/vendor/rails/actionview/test/fixtures/translations/templates/array.erb +1 -0
  953. data/vendor/rails/actionview/test/fixtures/translations/templates/default.erb +1 -0
  954. data/vendor/rails/actionview/test/fixtures/translations/templates/found.erb +1 -0
  955. data/vendor/rails/actionview/test/fixtures/translations/templates/missing.erb +1 -0
  956. data/vendor/rails/actionview/test/fixtures/with_format.json.erb +1 -0
  957. data/vendor/rails/actionview/test/lib/controller/fake_models.rb +204 -0
  958. data/vendor/rails/actionview/test/template/active_model_helper_test.rb +172 -0
  959. data/vendor/rails/actionview/test/template/asset_tag_helper_test.rb +913 -0
  960. data/vendor/rails/actionview/test/template/atom_feed_helper_test.rb +375 -0
  961. data/vendor/rails/actionview/test/template/capture_helper_test.rb +228 -0
  962. data/vendor/rails/actionview/test/template/compiled_templates_test.rb +94 -0
  963. data/vendor/rails/actionview/test/template/controller_helper_test.rb +34 -0
  964. data/vendor/rails/actionview/test/template/date_helper_i18n_test.rb +166 -0
  965. data/vendor/rails/actionview/test/template/date_helper_test.rb +3642 -0
  966. data/vendor/rails/actionview/test/template/dependency_tracker_test.rb +195 -0
  967. data/vendor/rails/actionview/test/template/digestor_test.rb +389 -0
  968. data/vendor/rails/actionview/test/template/erb/form_for_test.rb +13 -0
  969. data/vendor/rails/actionview/test/template/erb/helper.rb +26 -0
  970. data/vendor/rails/actionview/test/template/erb/tag_helper_test.rb +32 -0
  971. data/vendor/rails/actionview/test/template/erb_util_test.rb +114 -0
  972. data/vendor/rails/actionview/test/template/form_collections_helper_test.rb +527 -0
  973. data/vendor/rails/actionview/test/template/form_helper/form_with_test.rb +2293 -0
  974. data/vendor/rails/actionview/test/template/form_helper_test.rb +3554 -0
  975. data/vendor/rails/actionview/test/template/form_options_helper_i18n_test.rb +30 -0
  976. data/vendor/rails/actionview/test/template/form_options_helper_test.rb +1452 -0
  977. data/vendor/rails/actionview/test/template/form_tag_helper_test.rb +785 -0
  978. data/vendor/rails/actionview/test/template/html_test.rb +19 -0
  979. data/vendor/rails/actionview/test/template/javascript_helper_test.rb +68 -0
  980. data/vendor/rails/actionview/test/template/log_subscriber_test.rb +224 -0
  981. data/vendor/rails/actionview/test/template/lookup_context_test.rb +289 -0
  982. data/vendor/rails/actionview/test/template/number_helper_test.rb +204 -0
  983. data/vendor/rails/actionview/test/template/output_safety_helper_test.rb +119 -0
  984. data/vendor/rails/actionview/test/template/partial_iteration_test.rb +35 -0
  985. data/vendor/rails/actionview/test/template/record_identifier_test.rb +93 -0
  986. data/vendor/rails/actionview/test/template/record_tag_helper_test.rb +33 -0
  987. data/vendor/rails/actionview/test/template/render_test.rb +725 -0
  988. data/vendor/rails/actionview/test/template/resolver_cache_test.rb +9 -0
  989. data/vendor/rails/actionview/test/template/resolver_patterns_test.rb +44 -0
  990. data/vendor/rails/actionview/test/template/sanitize_helper_test.rb +43 -0
  991. data/vendor/rails/actionview/test/template/streaming_render_test.rb +132 -0
  992. data/vendor/rails/actionview/test/template/tag_helper_test.rb +357 -0
  993. data/vendor/rails/actionview/test/template/template_error_test.rb +37 -0
  994. data/vendor/rails/actionview/test/template/template_test.rb +207 -0
  995. data/vendor/rails/actionview/test/template/test_case_test.rb +335 -0
  996. data/vendor/rails/actionview/test/template/test_test.rb +94 -0
  997. data/vendor/rails/actionview/test/template/testing/fixture_resolver_test.rb +20 -0
  998. data/vendor/rails/actionview/test/template/testing/null_resolver_test.rb +14 -0
  999. data/vendor/rails/actionview/test/template/text_helper_test.rb +535 -0
  1000. data/vendor/rails/actionview/test/template/text_test.rb +25 -0
  1001. data/vendor/rails/actionview/test/template/translation_helper_test.rb +238 -0
  1002. data/vendor/rails/actionview/test/template/url_helper_test.rb +976 -0
  1003. data/vendor/rails/actionview/test/ujs/config.ru +6 -0
  1004. data/vendor/rails/actionview/test/ujs/public/test/call-ajax.js +26 -0
  1005. data/vendor/rails/actionview/test/ujs/public/test/call-remote-callbacks.js +239 -0
  1006. data/vendor/rails/actionview/test/ujs/public/test/call-remote.js +275 -0
  1007. data/vendor/rails/actionview/test/ujs/public/test/csrf-refresh.js +24 -0
  1008. data/vendor/rails/actionview/test/ujs/public/test/csrf-token.js +27 -0
  1009. data/vendor/rails/actionview/test/ujs/public/test/data-confirm.js +316 -0
  1010. data/vendor/rails/actionview/test/ujs/public/test/data-disable-with.js +394 -0
  1011. data/vendor/rails/actionview/test/ujs/public/test/data-disable.js +322 -0
  1012. data/vendor/rails/actionview/test/ujs/public/test/data-method.js +85 -0
  1013. data/vendor/rails/actionview/test/ujs/public/test/data-remote.js +441 -0
  1014. data/vendor/rails/actionview/test/ujs/public/test/override.js +56 -0
  1015. data/vendor/rails/actionview/test/ujs/public/test/settings.js +118 -0
  1016. data/vendor/rails/actionview/test/ujs/public/vendor/jquery-2.2.0.js +9831 -0
  1017. data/vendor/rails/actionview/test/ujs/public/vendor/jquery.metadata.js +122 -0
  1018. data/vendor/rails/actionview/test/ujs/public/vendor/qunit.css +237 -0
  1019. data/vendor/rails/actionview/test/ujs/public/vendor/qunit.js +2288 -0
  1020. data/vendor/rails/actionview/test/ujs/server.rb +86 -0
  1021. data/vendor/rails/actionview/test/ujs/views/layouts/application.html.erb +26 -0
  1022. data/vendor/rails/actionview/test/ujs/views/tests/index.html.erb +11 -0
  1023. data/vendor/rails/ci/qunit-selenium-runner.rb +16 -0
  1024. data/vendor/rails/ci/travis.rb +187 -0
  1025. data/vendor/rails/rails.gemspec +36 -0
  1026. data/vendor/rails/version.rb +17 -0
  1027. metadata +1030 -30
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "abstract_unit"
4
+
5
+ class RequestIdTest < ActiveSupport::TestCase
6
+ test "passing on the request id from the outside" do
7
+ assert_equal "external-uu-rid", stub_request("HTTP_X_REQUEST_ID" => "external-uu-rid").request_id
8
+ end
9
+
10
+ test "ensure that only alphanumeric uurids are accepted" do
11
+ assert_equal "X-Hacked-HeaderStuff", stub_request("HTTP_X_REQUEST_ID" => "; X-Hacked-Header: Stuff").request_id
12
+ end
13
+
14
+ test "accept Apache mod_unique_id format" do
15
+ mod_unique_id = "abcxyz@ABCXYZ-0123456789"
16
+ assert_equal mod_unique_id, stub_request("HTTP_X_REQUEST_ID" => mod_unique_id).request_id
17
+ end
18
+
19
+ test "ensure that 255 char limit on the request id is being enforced" do
20
+ assert_equal "X" * 255, stub_request("HTTP_X_REQUEST_ID" => "X" * 500).request_id
21
+ end
22
+
23
+ test "generating a request id when none is supplied" do
24
+ assert_match(/\w+-\w+-\w+-\w+-\w+/, stub_request.request_id)
25
+ end
26
+
27
+ test "uuid alias" do
28
+ assert_equal "external-uu-rid", stub_request("HTTP_X_REQUEST_ID" => "external-uu-rid").uuid
29
+ end
30
+
31
+ private
32
+
33
+ def stub_request(env = {})
34
+ ActionDispatch::RequestId.new(lambda { |environment| [ 200, environment, [] ] }).call(env)
35
+ ActionDispatch::Request.new(env)
36
+ end
37
+ end
38
+
39
+ class RequestIdResponseTest < ActionDispatch::IntegrationTest
40
+ class TestController < ActionController::Base
41
+ def index
42
+ head :ok
43
+ end
44
+ end
45
+
46
+ test "request id is passed all the way to the response" do
47
+ with_test_route_set do
48
+ get "/"
49
+ assert_match(/\w+/, @response.headers["X-Request-Id"])
50
+ end
51
+ end
52
+
53
+ test "request id given on request is passed all the way to the response" do
54
+ with_test_route_set do
55
+ get "/", headers: { "HTTP_X_REQUEST_ID" => "X" * 500 }
56
+ assert_equal "X" * 255, @response.headers["X-Request-Id"]
57
+ end
58
+ end
59
+
60
+ private
61
+
62
+ def with_test_route_set
63
+ with_routing do |set|
64
+ set.draw do
65
+ get "/", to: ::RequestIdResponseTest::TestController.action(:index)
66
+ end
67
+
68
+ @app = self.class.build_app(set) do |middleware|
69
+ middleware.use ActionDispatch::RequestId
70
+ end
71
+
72
+ yield
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,1307 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "abstract_unit"
4
+
5
+ class BaseRequestTest < ActiveSupport::TestCase
6
+ def setup
7
+ @env = {
8
+ :ip_spoofing_check => true,
9
+ "rack.input" => "foo"
10
+ }
11
+ @original_tld_length = ActionDispatch::Http::URL.tld_length
12
+ end
13
+
14
+ def teardown
15
+ ActionDispatch::Http::URL.tld_length = @original_tld_length
16
+ end
17
+
18
+ def url_for(options = {})
19
+ options = { host: "www.example.com" }.merge!(options)
20
+ ActionDispatch::Http::URL.url_for(options)
21
+ end
22
+
23
+ private
24
+ def stub_request(env = {})
25
+ ip_spoofing_check = env.key?(:ip_spoofing_check) ? env.delete(:ip_spoofing_check) : true
26
+ @trusted_proxies ||= nil
27
+ ip_app = ActionDispatch::RemoteIp.new(Proc.new {}, ip_spoofing_check, @trusted_proxies)
28
+ ActionDispatch::Http::URL.tld_length = env.delete(:tld_length) if env.key?(:tld_length)
29
+
30
+ ip_app.call(env)
31
+
32
+ env = @env.merge(env)
33
+ ActionDispatch::Request.new(env)
34
+ end
35
+ end
36
+
37
+ class RequestUrlFor < BaseRequestTest
38
+ test "url_for class method" do
39
+ e = assert_raise(ArgumentError) { url_for(host: nil) }
40
+ assert_match(/Please provide the :host parameter/, e.message)
41
+
42
+ assert_equal "/books", url_for(only_path: true, path: "/books")
43
+
44
+ assert_equal "http://www.example.com/books/?q=code", url_for(trailing_slash: true, path: "/books?q=code")
45
+ assert_equal "http://www.example.com/books/?spareslashes=////", url_for(trailing_slash: true, path: "/books?spareslashes=////")
46
+
47
+ assert_equal "http://www.example.com", url_for
48
+ assert_equal "http://api.example.com", url_for(subdomain: "api")
49
+ assert_equal "http://example.com", url_for(subdomain: false)
50
+ assert_equal "http://www.ror.com", url_for(domain: "ror.com")
51
+ assert_equal "http://api.ror.co.uk", url_for(host: "www.ror.co.uk", subdomain: "api", tld_length: 2)
52
+ assert_equal "http://www.example.com:8080", url_for(port: 8080)
53
+ assert_equal "https://www.example.com", url_for(protocol: "https")
54
+ assert_equal "http://www.example.com/docs", url_for(path: "/docs")
55
+ assert_equal "http://www.example.com#signup", url_for(anchor: "signup")
56
+ assert_equal "http://www.example.com/", url_for(trailing_slash: true)
57
+ assert_equal "http://dhh:supersecret@www.example.com", url_for(user: "dhh", password: "supersecret")
58
+ assert_equal "http://www.example.com?search=books", url_for(params: { search: "books" })
59
+ assert_equal "http://www.example.com?params=", url_for(params: "")
60
+ assert_equal "http://www.example.com?params=1", url_for(params: 1)
61
+ end
62
+ end
63
+
64
+ class RequestIP < BaseRequestTest
65
+ test "remote ip" do
66
+ request = stub_request "REMOTE_ADDR" => "1.2.3.4"
67
+ assert_equal "1.2.3.4", request.remote_ip
68
+
69
+ request = stub_request "REMOTE_ADDR" => "1.2.3.4,3.4.5.6"
70
+ assert_equal "3.4.5.6", request.remote_ip
71
+
72
+ request = stub_request "REMOTE_ADDR" => "1.2.3.4",
73
+ "HTTP_X_FORWARDED_FOR" => "3.4.5.6"
74
+ assert_equal "3.4.5.6", request.remote_ip
75
+
76
+ request = stub_request "REMOTE_ADDR" => "127.0.0.1",
77
+ "HTTP_X_FORWARDED_FOR" => "3.4.5.6"
78
+ assert_equal "3.4.5.6", request.remote_ip
79
+
80
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "3.4.5.6,unknown"
81
+ assert_equal "3.4.5.6", request.remote_ip
82
+
83
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "3.4.5.6,172.16.0.1"
84
+ assert_equal "3.4.5.6", request.remote_ip
85
+
86
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "3.4.5.6,192.168.0.1"
87
+ assert_equal "3.4.5.6", request.remote_ip
88
+
89
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "3.4.5.6,10.0.0.1"
90
+ assert_equal "3.4.5.6", request.remote_ip
91
+
92
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "3.4.5.6, 10.0.0.1, 10.0.0.1"
93
+ assert_equal "3.4.5.6", request.remote_ip
94
+
95
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "3.4.5.6,127.0.0.1"
96
+ assert_equal "3.4.5.6", request.remote_ip
97
+
98
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "unknown,192.168.0.1"
99
+ assert_nil request.remote_ip
100
+
101
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "9.9.9.9, 3.4.5.6, 172.31.4.4, 10.0.0.1"
102
+ assert_equal "3.4.5.6", request.remote_ip
103
+
104
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "not_ip_address"
105
+ assert_nil request.remote_ip
106
+ end
107
+
108
+ test "remote ip spoof detection" do
109
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "1.1.1.1",
110
+ "HTTP_CLIENT_IP" => "2.2.2.2"
111
+ e = assert_raise(ActionDispatch::RemoteIp::IpSpoofAttackError) {
112
+ request.remote_ip
113
+ }
114
+ assert_match(/IP spoofing attack/, e.message)
115
+ assert_match(/HTTP_X_FORWARDED_FOR="1\.1\.1\.1"/, e.message)
116
+ assert_match(/HTTP_CLIENT_IP="2\.2\.2\.2"/, e.message)
117
+ end
118
+
119
+ test "remote ip with spoof detection disabled" do
120
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "1.1.1.1",
121
+ "HTTP_CLIENT_IP" => "2.2.2.2",
122
+ :ip_spoofing_check => false
123
+ assert_equal "1.1.1.1", request.remote_ip
124
+ end
125
+
126
+ test "remote ip spoof protection ignores private addresses" do
127
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "172.17.19.51",
128
+ "HTTP_CLIENT_IP" => "172.17.19.51",
129
+ "REMOTE_ADDR" => "1.1.1.1",
130
+ "HTTP_X_BLUECOAT_VIA" => "de462e07a2db325e"
131
+ assert_equal "1.1.1.1", request.remote_ip
132
+ end
133
+
134
+ test "remote ip v6" do
135
+ request = stub_request "REMOTE_ADDR" => "2001:0db8:85a3:0000:0000:8a2e:0370:7334"
136
+ assert_equal "2001:0db8:85a3:0000:0000:8a2e:0370:7334", request.remote_ip
137
+
138
+ request = stub_request "REMOTE_ADDR" => "fe80:0000:0000:0000:0202:b3ff:fe1e:8329,2001:0db8:85a3:0000:0000:8a2e:0370:7334"
139
+ assert_equal "2001:0db8:85a3:0000:0000:8a2e:0370:7334", request.remote_ip
140
+
141
+ request = stub_request "REMOTE_ADDR" => "2001:0db8:85a3:0000:0000:8a2e:0370:7334",
142
+ "HTTP_X_FORWARDED_FOR" => "fe80:0000:0000:0000:0202:b3ff:fe1e:8329"
143
+ assert_equal "fe80:0000:0000:0000:0202:b3ff:fe1e:8329", request.remote_ip
144
+
145
+ request = stub_request "REMOTE_ADDR" => "::1",
146
+ "HTTP_X_FORWARDED_FOR" => "fe80:0000:0000:0000:0202:b3ff:fe1e:8329"
147
+ assert_equal "fe80:0000:0000:0000:0202:b3ff:fe1e:8329", request.remote_ip
148
+
149
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "fe80:0000:0000:0000:0202:b3ff:fe1e:8329,unknown"
150
+ assert_equal "fe80:0000:0000:0000:0202:b3ff:fe1e:8329", request.remote_ip
151
+
152
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "fe80:0000:0000:0000:0202:b3ff:fe1e:8329,::1"
153
+ assert_equal "fe80:0000:0000:0000:0202:b3ff:fe1e:8329", request.remote_ip
154
+
155
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "fe80:0000:0000:0000:0202:b3ff:fe1e:8329, ::1, ::1"
156
+ assert_equal "fe80:0000:0000:0000:0202:b3ff:fe1e:8329", request.remote_ip
157
+
158
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "unknown,::1"
159
+ assert_nil request.remote_ip
160
+
161
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "2001:0db8:85a3:0000:0000:8a2e:0370:7334, fe80:0000:0000:0000:0202:b3ff:fe1e:8329, ::1, fc00::, fc01::, fdff"
162
+ assert_equal "fe80:0000:0000:0000:0202:b3ff:fe1e:8329", request.remote_ip
163
+
164
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "FE00::, FDFF::"
165
+ assert_equal "FE00::", request.remote_ip
166
+
167
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "not_ip_address"
168
+ assert_nil request.remote_ip
169
+ end
170
+
171
+ test "remote ip v6 spoof detection" do
172
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "fe80:0000:0000:0000:0202:b3ff:fe1e:8329",
173
+ "HTTP_CLIENT_IP" => "2001:0db8:85a3:0000:0000:8a2e:0370:7334"
174
+ e = assert_raise(ActionDispatch::RemoteIp::IpSpoofAttackError) {
175
+ request.remote_ip
176
+ }
177
+ assert_match(/IP spoofing attack/, e.message)
178
+ assert_match(/HTTP_X_FORWARDED_FOR="fe80:0000:0000:0000:0202:b3ff:fe1e:8329"/, e.message)
179
+ assert_match(/HTTP_CLIENT_IP="2001:0db8:85a3:0000:0000:8a2e:0370:7334"/, e.message)
180
+ end
181
+
182
+ test "remote ip v6 spoof detection disabled" do
183
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "fe80:0000:0000:0000:0202:b3ff:fe1e:8329",
184
+ "HTTP_CLIENT_IP" => "2001:0db8:85a3:0000:0000:8a2e:0370:7334",
185
+ :ip_spoofing_check => false
186
+ assert_equal "fe80:0000:0000:0000:0202:b3ff:fe1e:8329", request.remote_ip
187
+ end
188
+
189
+ test "remote ip with user specified trusted proxies String" do
190
+ @trusted_proxies = "67.205.106.73"
191
+
192
+ request = stub_request "REMOTE_ADDR" => "3.4.5.6",
193
+ "HTTP_X_FORWARDED_FOR" => "67.205.106.73"
194
+ assert_equal "3.4.5.6", request.remote_ip
195
+
196
+ request = stub_request "REMOTE_ADDR" => "172.16.0.1,67.205.106.73",
197
+ "HTTP_X_FORWARDED_FOR" => "67.205.106.73"
198
+ assert_equal "67.205.106.73", request.remote_ip
199
+
200
+ request = stub_request "REMOTE_ADDR" => "67.205.106.73,3.4.5.6",
201
+ "HTTP_X_FORWARDED_FOR" => "67.205.106.73"
202
+ assert_equal "3.4.5.6", request.remote_ip
203
+
204
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "67.205.106.73,unknown"
205
+ assert_nil request.remote_ip
206
+
207
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "9.9.9.9, 3.4.5.6, 10.0.0.1, 67.205.106.73"
208
+ assert_equal "3.4.5.6", request.remote_ip
209
+ end
210
+
211
+ test "remote ip v6 with user specified trusted proxies String" do
212
+ @trusted_proxies = "fe80:0000:0000:0000:0202:b3ff:fe1e:8329"
213
+
214
+ request = stub_request "REMOTE_ADDR" => "2001:0db8:85a3:0000:0000:8a2e:0370:7334",
215
+ "HTTP_X_FORWARDED_FOR" => "fe80:0000:0000:0000:0202:b3ff:fe1e:8329"
216
+ assert_equal "2001:0db8:85a3:0000:0000:8a2e:0370:7334", request.remote_ip
217
+
218
+ request = stub_request "REMOTE_ADDR" => "fe80:0000:0000:0000:0202:b3ff:fe1e:8329,2001:0db8:85a3:0000:0000:8a2e:0370:7334",
219
+ "HTTP_X_FORWARDED_FOR" => "fe80:0000:0000:0000:0202:b3ff:fe1e:8329"
220
+ assert_equal "2001:0db8:85a3:0000:0000:8a2e:0370:7334", request.remote_ip
221
+
222
+ request = stub_request "REMOTE_ADDR" => "fe80:0000:0000:0000:0202:b3ff:fe1e:8329,::1",
223
+ "HTTP_X_FORWARDED_FOR" => "fe80:0000:0000:0000:0202:b3ff:fe1e:8329"
224
+ assert_equal "::1", request.remote_ip
225
+
226
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "unknown,fe80:0000:0000:0000:0202:b3ff:fe1e:8329"
227
+ assert_nil request.remote_ip
228
+
229
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "fe80:0000:0000:0000:0202:b3ff:fe1e:8329,2001:0db8:85a3:0000:0000:8a2e:0370:7334"
230
+ assert_equal "2001:0db8:85a3:0000:0000:8a2e:0370:7334", request.remote_ip
231
+ end
232
+
233
+ test "remote ip with user specified trusted proxies Regexp" do
234
+ @trusted_proxies = /^67\.205\.106\.73$/i
235
+
236
+ request = stub_request "REMOTE_ADDR" => "67.205.106.73",
237
+ "HTTP_X_FORWARDED_FOR" => "3.4.5.6"
238
+ assert_equal "3.4.5.6", request.remote_ip
239
+
240
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "10.0.0.1, 9.9.9.9, 3.4.5.6, 67.205.106.73"
241
+ assert_equal "3.4.5.6", request.remote_ip
242
+ end
243
+
244
+ test "remote ip v6 with user specified trusted proxies Regexp" do
245
+ @trusted_proxies = /^fe80:0000:0000:0000:0202:b3ff:fe1e:8329$/i
246
+
247
+ request = stub_request "REMOTE_ADDR" => "2001:0db8:85a3:0000:0000:8a2e:0370:7334",
248
+ "HTTP_X_FORWARDED_FOR" => "fe80:0000:0000:0000:0202:b3ff:fe1e:8329"
249
+ assert_equal "2001:0db8:85a3:0000:0000:8a2e:0370:7334", request.remote_ip
250
+
251
+ request = stub_request "HTTP_X_FORWARDED_FOR" => "2001:0db8:85a3:0000:0000:8a2e:0370:7334, fe80:0000:0000:0000:0202:b3ff:fe1e:8329"
252
+ assert_equal "2001:0db8:85a3:0000:0000:8a2e:0370:7334", request.remote_ip
253
+ end
254
+
255
+ test "remote ip middleware not present still returns an IP" do
256
+ request = stub_request("REMOTE_ADDR" => "127.0.0.1")
257
+ assert_equal "127.0.0.1", request.remote_ip
258
+ end
259
+ end
260
+
261
+ class RequestDomain < BaseRequestTest
262
+ test "domains" do
263
+ request = stub_request "HTTP_HOST" => "192.168.1.200"
264
+ assert_nil request.domain
265
+
266
+ request = stub_request "HTTP_HOST" => "foo.192.168.1.200"
267
+ assert_nil request.domain
268
+
269
+ request = stub_request "HTTP_HOST" => "192.168.1.200.com"
270
+ assert_equal "200.com", request.domain
271
+
272
+ request = stub_request "HTTP_HOST" => "www.rubyonrails.org"
273
+ assert_equal "rubyonrails.org", request.domain
274
+
275
+ request = stub_request "HTTP_HOST" => "www.rubyonrails.co.uk"
276
+ assert_equal "rubyonrails.co.uk", request.domain(2)
277
+
278
+ request = stub_request "HTTP_HOST" => "www.rubyonrails.co.uk", :tld_length => 2
279
+ assert_equal "rubyonrails.co.uk", request.domain
280
+ end
281
+
282
+ test "subdomains" do
283
+ request = stub_request "HTTP_HOST" => "foobar.foobar.com"
284
+ assert_equal %w( foobar ), request.subdomains
285
+ assert_equal "foobar", request.subdomain
286
+
287
+ request = stub_request "HTTP_HOST" => "192.168.1.200"
288
+ assert_equal [], request.subdomains
289
+ assert_equal "", request.subdomain
290
+
291
+ request = stub_request "HTTP_HOST" => "foo.192.168.1.200"
292
+ assert_equal [], request.subdomains
293
+ assert_equal "", request.subdomain
294
+
295
+ request = stub_request "HTTP_HOST" => "192.168.1.200.com"
296
+ assert_equal %w( 192 168 1 ), request.subdomains
297
+ assert_equal "192.168.1", request.subdomain
298
+
299
+ request = stub_request "HTTP_HOST" => nil
300
+ assert_equal [], request.subdomains
301
+ assert_equal "", request.subdomain
302
+
303
+ request = stub_request "HTTP_HOST" => "www.rubyonrails.org"
304
+ assert_equal %w( www ), request.subdomains
305
+ assert_equal "www", request.subdomain
306
+
307
+ request = stub_request "HTTP_HOST" => "www.rubyonrails.co.uk"
308
+ assert_equal %w( www ), request.subdomains(2)
309
+ assert_equal "www", request.subdomain(2)
310
+
311
+ request = stub_request "HTTP_HOST" => "dev.www.rubyonrails.co.uk"
312
+ assert_equal %w( dev www ), request.subdomains(2)
313
+ assert_equal "dev.www", request.subdomain(2)
314
+
315
+ request = stub_request "HTTP_HOST" => "dev.www.rubyonrails.co.uk", :tld_length => 2
316
+ assert_equal %w( dev www ), request.subdomains
317
+ assert_equal "dev.www", request.subdomain
318
+ end
319
+ end
320
+
321
+ class RequestPort < BaseRequestTest
322
+ test "standard_port" do
323
+ request = stub_request
324
+ assert_equal 80, request.standard_port
325
+
326
+ request = stub_request "HTTPS" => "on"
327
+ assert_equal 443, request.standard_port
328
+ end
329
+
330
+ test "standard_port?" do
331
+ request = stub_request
332
+ assert_not_predicate request, :ssl?
333
+ assert_predicate request, :standard_port?
334
+
335
+ request = stub_request "HTTPS" => "on"
336
+ assert_predicate request, :ssl?
337
+ assert_predicate request, :standard_port?
338
+
339
+ request = stub_request "HTTP_HOST" => "www.example.org:8080"
340
+ assert_not_predicate request, :ssl?
341
+ assert_not_predicate request, :standard_port?
342
+
343
+ request = stub_request "HTTP_HOST" => "www.example.org:8443", "HTTPS" => "on"
344
+ assert_predicate request, :ssl?
345
+ assert_not_predicate request, :standard_port?
346
+ end
347
+
348
+ test "optional port" do
349
+ request = stub_request "HTTP_HOST" => "www.example.org:80"
350
+ assert_nil request.optional_port
351
+
352
+ request = stub_request "HTTP_HOST" => "www.example.org:8080"
353
+ assert_equal 8080, request.optional_port
354
+ end
355
+
356
+ test "port string" do
357
+ request = stub_request "HTTP_HOST" => "www.example.org:80"
358
+ assert_equal "", request.port_string
359
+
360
+ request = stub_request "HTTP_HOST" => "www.example.org:8080"
361
+ assert_equal ":8080", request.port_string
362
+ end
363
+
364
+ test "server port" do
365
+ request = stub_request "SERVER_PORT" => "8080"
366
+ assert_equal 8080, request.server_port
367
+
368
+ request = stub_request "SERVER_PORT" => "80"
369
+ assert_equal 80, request.server_port
370
+
371
+ request = stub_request "SERVER_PORT" => ""
372
+ assert_equal 0, request.server_port
373
+ end
374
+ end
375
+
376
+ class RequestPath < BaseRequestTest
377
+ test "full path" do
378
+ request = stub_request "SCRIPT_NAME" => "", "PATH_INFO" => "/path/of/some/uri", "QUERY_STRING" => "mapped=1"
379
+ assert_equal "/path/of/some/uri?mapped=1", request.fullpath
380
+ assert_equal "/path/of/some/uri", request.path_info
381
+
382
+ request = stub_request "SCRIPT_NAME" => "", "PATH_INFO" => "/path/of/some/uri"
383
+ assert_equal "/path/of/some/uri", request.fullpath
384
+ assert_equal "/path/of/some/uri", request.path_info
385
+
386
+ request = stub_request "SCRIPT_NAME" => "", "PATH_INFO" => "/"
387
+ assert_equal "/", request.fullpath
388
+ assert_equal "/", request.path_info
389
+
390
+ request = stub_request "SCRIPT_NAME" => "", "PATH_INFO" => "/", "QUERY_STRING" => "m=b"
391
+ assert_equal "/?m=b", request.fullpath
392
+ assert_equal "/", request.path_info
393
+
394
+ request = stub_request "SCRIPT_NAME" => "/hieraki", "PATH_INFO" => "/"
395
+ assert_equal "/hieraki/", request.fullpath
396
+ assert_equal "/", request.path_info
397
+
398
+ request = stub_request "SCRIPT_NAME" => "/collaboration/hieraki", "PATH_INFO" => "/books/edit/2"
399
+ assert_equal "/collaboration/hieraki/books/edit/2", request.fullpath
400
+ assert_equal "/books/edit/2", request.path_info
401
+
402
+ request = stub_request "SCRIPT_NAME" => "/path", "PATH_INFO" => "/of/some/uri", "QUERY_STRING" => "mapped=1"
403
+ assert_equal "/path/of/some/uri?mapped=1", request.fullpath
404
+ assert_equal "/of/some/uri", request.path_info
405
+ end
406
+
407
+ test "original_fullpath returns ORIGINAL_FULLPATH" do
408
+ request = stub_request("ORIGINAL_FULLPATH" => "/foo?bar")
409
+
410
+ path = request.original_fullpath
411
+ assert_equal "/foo?bar", path
412
+ end
413
+
414
+ test "original_url returns url built using ORIGINAL_FULLPATH" do
415
+ request = stub_request("ORIGINAL_FULLPATH" => "/foo?bar",
416
+ "HTTP_HOST" => "example.org",
417
+ "rack.url_scheme" => "http")
418
+
419
+ url = request.original_url
420
+ assert_equal "http://example.org/foo?bar", url
421
+ end
422
+
423
+ test "original_fullpath returns fullpath if ORIGINAL_FULLPATH is not present" do
424
+ request = stub_request("PATH_INFO" => "/foo",
425
+ "QUERY_STRING" => "bar")
426
+
427
+ path = request.original_fullpath
428
+ assert_equal "/foo?bar", path
429
+ end
430
+ end
431
+
432
+ class RequestHost < BaseRequestTest
433
+ test "host without specifying port" do
434
+ request = stub_request "HTTP_HOST" => "rubyonrails.org"
435
+ assert_equal "rubyonrails.org", request.host_with_port
436
+ end
437
+
438
+ test "host with default port" do
439
+ request = stub_request "HTTP_HOST" => "rubyonrails.org:80"
440
+ assert_equal "rubyonrails.org", request.host_with_port
441
+ end
442
+
443
+ test "host with non default port" do
444
+ request = stub_request "HTTP_HOST" => "rubyonrails.org:81"
445
+ assert_equal "rubyonrails.org:81", request.host_with_port
446
+ end
447
+
448
+ test "raw without specifying port" do
449
+ request = stub_request "HTTP_HOST" => "rubyonrails.org"
450
+ assert_equal "rubyonrails.org", request.raw_host_with_port
451
+ end
452
+
453
+ test "raw host with default port" do
454
+ request = stub_request "HTTP_HOST" => "rubyonrails.org:80"
455
+ assert_equal "rubyonrails.org:80", request.raw_host_with_port
456
+ end
457
+
458
+ test "raw host with non default port" do
459
+ request = stub_request "HTTP_HOST" => "rubyonrails.org:81"
460
+ assert_equal "rubyonrails.org:81", request.raw_host_with_port
461
+ end
462
+
463
+ test "proxy request" do
464
+ request = stub_request "HTTP_HOST" => "glu.ttono.us:80"
465
+ assert_equal "glu.ttono.us", request.host_with_port
466
+ end
467
+
468
+ test "http host" do
469
+ request = stub_request "HTTP_HOST" => "rubyonrails.org:8080"
470
+ assert_equal "rubyonrails.org", request.host
471
+ assert_equal "rubyonrails.org:8080", request.host_with_port
472
+
473
+ request = stub_request "HTTP_X_FORWARDED_HOST" => "www.firsthost.org, www.secondhost.org"
474
+ assert_equal "www.secondhost.org", request.host
475
+
476
+ request = stub_request "HTTP_X_FORWARDED_HOST" => "", "HTTP_HOST" => "rubyonrails.org"
477
+ assert_equal "rubyonrails.org", request.host
478
+ end
479
+
480
+ test "http host with default port overrides server port" do
481
+ request = stub_request "HTTP_HOST" => "rubyonrails.org"
482
+ assert_equal "rubyonrails.org", request.host_with_port
483
+ end
484
+
485
+ test "host with port if http standard port is specified" do
486
+ request = stub_request "HTTP_X_FORWARDED_HOST" => "glu.ttono.us:80"
487
+ assert_equal "glu.ttono.us", request.host_with_port
488
+ end
489
+
490
+ test "host with port if https standard port is specified" do
491
+ request = stub_request(
492
+ "HTTP_X_FORWARDED_PROTO" => "https",
493
+ "HTTP_X_FORWARDED_HOST" => "glu.ttono.us:443"
494
+ )
495
+ assert_equal "glu.ttono.us", request.host_with_port
496
+ end
497
+
498
+ test "host if ipv6 reference" do
499
+ request = stub_request "HTTP_HOST" => "[2001:1234:5678:9abc:def0::dead:beef]"
500
+ assert_equal "[2001:1234:5678:9abc:def0::dead:beef]", request.host
501
+ end
502
+
503
+ test "host if ipv6 reference with port" do
504
+ request = stub_request "HTTP_HOST" => "[2001:1234:5678:9abc:def0::dead:beef]:8008"
505
+ assert_equal "[2001:1234:5678:9abc:def0::dead:beef]", request.host
506
+ end
507
+ end
508
+
509
+ class RequestCGI < BaseRequestTest
510
+ test "CGI environment variables" do
511
+ request = stub_request(
512
+ "AUTH_TYPE" => "Basic",
513
+ "GATEWAY_INTERFACE" => "CGI/1.1",
514
+ "HTTP_ACCEPT" => "*/*",
515
+ "HTTP_ACCEPT_CHARSET" => "UTF-8",
516
+ "HTTP_ACCEPT_ENCODING" => "gzip, deflate",
517
+ "HTTP_ACCEPT_LANGUAGE" => "en",
518
+ "HTTP_CACHE_CONTROL" => "no-cache, max-age=0",
519
+ "HTTP_FROM" => "googlebot",
520
+ "HTTP_HOST" => "glu.ttono.us:8007",
521
+ "HTTP_NEGOTIATE" => "trans",
522
+ "HTTP_PRAGMA" => "no-cache",
523
+ "HTTP_REFERER" => "http://www.google.com/search?q=glu.ttono.us",
524
+ "HTTP_USER_AGENT" => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en)",
525
+ "PATH_INFO" => "/homepage/",
526
+ "PATH_TRANSLATED" => "/home/kevinc/sites/typo/public/homepage/",
527
+ "QUERY_STRING" => "",
528
+ "REMOTE_ADDR" => "207.7.108.53",
529
+ "REMOTE_HOST" => "google.com",
530
+ "REMOTE_IDENT" => "kevin",
531
+ "REMOTE_USER" => "kevin",
532
+ "REQUEST_METHOD" => "GET",
533
+ "SCRIPT_NAME" => "/dispatch.fcgi",
534
+ "SERVER_NAME" => "glu.ttono.us",
535
+ "SERVER_PORT" => "8007",
536
+ "SERVER_PROTOCOL" => "HTTP/1.1",
537
+ "SERVER_SOFTWARE" => "lighttpd/1.4.5",
538
+ )
539
+
540
+ assert_equal "Basic", request.auth_type
541
+ assert_equal 0, request.content_length
542
+ assert_nil request.content_mime_type
543
+ assert_equal "CGI/1.1", request.gateway_interface
544
+ assert_equal "*/*", request.accept
545
+ assert_equal "UTF-8", request.accept_charset
546
+ assert_equal "gzip, deflate", request.accept_encoding
547
+ assert_equal "en", request.accept_language
548
+ assert_equal "no-cache, max-age=0", request.cache_control
549
+ assert_equal "googlebot", request.from
550
+ assert_equal "glu.ttono.us", request.host
551
+ assert_equal "trans", request.negotiate
552
+ assert_equal "no-cache", request.pragma
553
+ assert_equal "http://www.google.com/search?q=glu.ttono.us", request.referer
554
+ assert_equal "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en)", request.user_agent
555
+ assert_equal "/homepage/", request.path_info
556
+ assert_equal "/home/kevinc/sites/typo/public/homepage/", request.path_translated
557
+ assert_equal "", request.query_string
558
+ assert_equal "207.7.108.53", request.remote_addr
559
+ assert_equal "google.com", request.remote_host
560
+ assert_equal "kevin", request.remote_ident
561
+ assert_equal "kevin", request.remote_user
562
+ assert_equal "GET", request.request_method
563
+ assert_equal "/dispatch.fcgi", request.script_name
564
+ assert_equal "glu.ttono.us", request.server_name
565
+ assert_equal 8007, request.server_port
566
+ assert_equal "HTTP/1.1", request.server_protocol
567
+ assert_equal "lighttpd", request.server_software
568
+ end
569
+ end
570
+
571
+ class LocalhostTest < BaseRequestTest
572
+ test "IPs that match localhost" do
573
+ request = stub_request("REMOTE_IP" => "127.1.1.1", "REMOTE_ADDR" => "127.1.1.1")
574
+ assert_predicate request, :local?
575
+ end
576
+ end
577
+
578
+ class RequestCookie < BaseRequestTest
579
+ test "cookie syntax resilience" do
580
+ request = stub_request("HTTP_COOKIE" => "_session_id=c84ace84796670c052c6ceb2451fb0f2; is_admin=yes")
581
+ assert_equal "c84ace84796670c052c6ceb2451fb0f2", request.cookies["_session_id"], request.cookies.inspect
582
+ assert_equal "yes", request.cookies["is_admin"], request.cookies.inspect
583
+
584
+ # some Nokia phone browsers omit the space after the semicolon separator.
585
+ # some developers have grown accustomed to using comma in cookie values.
586
+ request = stub_request("HTTP_COOKIE" => "_session_id=c84ace847,96670c052c6ceb2451fb0f2;is_admin=yes")
587
+ assert_equal "c84ace847", request.cookies["_session_id"], request.cookies.inspect
588
+ assert_equal "yes", request.cookies["is_admin"], request.cookies.inspect
589
+ end
590
+ end
591
+
592
+ class RequestParamsParsing < BaseRequestTest
593
+ test "doesnt break when content type has charset" do
594
+ request = stub_request(
595
+ "REQUEST_METHOD" => "POST",
596
+ "CONTENT_LENGTH" => "flamenco=love".length,
597
+ "CONTENT_TYPE" => "application/x-www-form-urlencoded; charset=utf-8",
598
+ "rack.input" => StringIO.new("flamenco=love")
599
+ )
600
+
601
+ assert_equal({ "flamenco" => "love" }, request.request_parameters)
602
+ end
603
+
604
+ test "doesnt interpret request uri as query string when missing" do
605
+ request = stub_request("REQUEST_URI" => "foo")
606
+ assert_equal({}, request.query_parameters)
607
+ end
608
+ end
609
+
610
+ class RequestRewind < BaseRequestTest
611
+ test "body should be rewound" do
612
+ data = "rewind"
613
+ env = {
614
+ "rack.input" => StringIO.new(data),
615
+ "CONTENT_LENGTH" => data.length,
616
+ "CONTENT_TYPE" => "application/x-www-form-urlencoded; charset=utf-8"
617
+ }
618
+
619
+ # Read the request body by parsing params.
620
+ request = stub_request(env)
621
+ request.request_parameters
622
+
623
+ # Should have rewound the body.
624
+ assert_equal 0, request.body.pos
625
+ end
626
+
627
+ test "raw_post rewinds rack.input if RAW_POST_DATA is nil" do
628
+ request = stub_request(
629
+ "rack.input" => StringIO.new("raw"),
630
+ "CONTENT_LENGTH" => 3
631
+ )
632
+ assert_equal "raw", request.raw_post
633
+ assert_equal "raw", request.env["rack.input"].read
634
+ end
635
+ end
636
+
637
+ class RequestProtocol < BaseRequestTest
638
+ test "server software" do
639
+ assert_equal "lighttpd", stub_request("SERVER_SOFTWARE" => "lighttpd/1.4.5").server_software
640
+ assert_equal "apache", stub_request("SERVER_SOFTWARE" => "Apache3.422").server_software
641
+ end
642
+
643
+ test "xml http request" do
644
+ request = stub_request
645
+
646
+ assert_not_predicate request, :xml_http_request?
647
+ assert_not_predicate request, :xhr?
648
+
649
+ request = stub_request "HTTP_X_REQUESTED_WITH" => "DefinitelyNotAjax1.0"
650
+ assert_not_predicate request, :xml_http_request?
651
+ assert_not_predicate request, :xhr?
652
+
653
+ request = stub_request "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest"
654
+ assert_predicate request, :xml_http_request?
655
+ assert_predicate request, :xhr?
656
+ end
657
+
658
+ test "reports ssl" do
659
+ assert_not_predicate stub_request, :ssl?
660
+ assert_predicate stub_request("HTTPS" => "on"), :ssl?
661
+ end
662
+
663
+ test "reports ssl when proxied via lighttpd" do
664
+ assert_predicate stub_request("HTTP_X_FORWARDED_PROTO" => "https"), :ssl?
665
+ end
666
+
667
+ test "scheme returns https when proxied" do
668
+ request = stub_request "rack.url_scheme" => "http"
669
+ assert_not_predicate request, :ssl?
670
+ assert_equal "http", request.scheme
671
+
672
+ request = stub_request(
673
+ "rack.url_scheme" => "http",
674
+ "HTTP_X_FORWARDED_PROTO" => "https"
675
+ )
676
+ assert_predicate request, :ssl?
677
+ assert_equal "https", request.scheme
678
+ end
679
+ end
680
+
681
+ class RequestMethod < BaseRequestTest
682
+ test "method returns environment's request method when it has not been
683
+ overridden by middleware".squish do
684
+
685
+ ActionDispatch::Request::HTTP_METHODS.each do |method|
686
+ request = stub_request("REQUEST_METHOD" => method)
687
+
688
+ assert_equal method, request.method
689
+ assert_equal method.underscore.to_sym, request.method_symbol
690
+ end
691
+ end
692
+
693
+ test "allow request method hacking" do
694
+ request = stub_request("REQUEST_METHOD" => "POST")
695
+
696
+ assert_equal "POST", request.request_method
697
+ assert_equal "POST", request.env["REQUEST_METHOD"]
698
+
699
+ request.request_method = "GET"
700
+
701
+ assert_equal "GET", request.request_method
702
+ assert_equal "GET", request.env["REQUEST_METHOD"]
703
+ assert_predicate request, :get?
704
+ end
705
+
706
+ test "invalid http method raises exception" do
707
+ assert_raise(ActionController::UnknownHttpMethod) do
708
+ stub_request("REQUEST_METHOD" => "RANDOM_METHOD").request_method
709
+ end
710
+ end
711
+
712
+ test "method returns original value of environment request method on POST" do
713
+ request = stub_request("rack.methodoverride.original_method" => "POST")
714
+ assert_equal "POST", request.method
715
+ end
716
+
717
+ test "method raises exception on invalid HTTP method" do
718
+ assert_raise(ActionController::UnknownHttpMethod) do
719
+ stub_request("rack.methodoverride.original_method" => "_RANDOM_METHOD").method
720
+ end
721
+
722
+ assert_raise(ActionController::UnknownHttpMethod) do
723
+ stub_request("REQUEST_METHOD" => "_RANDOM_METHOD").method
724
+ end
725
+ end
726
+
727
+ test "exception on invalid HTTP method unaffected by I18n settings" do
728
+ old_locales = I18n.available_locales
729
+ old_enforce = I18n.config.enforce_available_locales
730
+
731
+ begin
732
+ I18n.available_locales = [:nl]
733
+ I18n.config.enforce_available_locales = true
734
+ assert_raise(ActionController::UnknownHttpMethod) do
735
+ stub_request("REQUEST_METHOD" => "_RANDOM_METHOD").method
736
+ end
737
+ ensure
738
+ I18n.available_locales = old_locales
739
+ I18n.config.enforce_available_locales = old_enforce
740
+ end
741
+ end
742
+
743
+ test "post masquerading as patch" do
744
+ request = stub_request(
745
+ "REQUEST_METHOD" => "PATCH",
746
+ "rack.methodoverride.original_method" => "POST"
747
+ )
748
+
749
+ assert_equal "POST", request.method
750
+ assert_equal "PATCH", request.request_method
751
+ assert_predicate request, :patch?
752
+ end
753
+
754
+ test "post masquerading as put" do
755
+ request = stub_request(
756
+ "REQUEST_METHOD" => "PUT",
757
+ "rack.methodoverride.original_method" => "POST"
758
+ )
759
+ assert_equal "POST", request.method
760
+ assert_equal "PUT", request.request_method
761
+ assert_predicate request, :put?
762
+ end
763
+
764
+ test "post uneffected by local inflections" do
765
+ existing_acronyms = ActiveSupport::Inflector.inflections.acronyms.dup
766
+ assert_deprecated { ActiveSupport::Inflector.inflections.acronym_regex.dup }
767
+ begin
768
+ ActiveSupport::Inflector.inflections do |inflect|
769
+ inflect.acronym "POS"
770
+ end
771
+ assert_equal "pos_t", "POST".underscore
772
+ request = stub_request "REQUEST_METHOD" => "POST"
773
+ assert_equal :post, ActionDispatch::Request::HTTP_METHOD_LOOKUP["POST"]
774
+ assert_equal :post, request.method_symbol
775
+ assert_predicate request, :post?
776
+ ensure
777
+ # Reset original acronym set
778
+ ActiveSupport::Inflector.inflections do |inflect|
779
+ inflect.send(:instance_variable_set, "@acronyms", existing_acronyms)
780
+ inflect.send(:define_acronym_regex_patterns)
781
+ end
782
+ end
783
+ end
784
+ end
785
+
786
+ class RequestFormat < BaseRequestTest
787
+ test "xml format" do
788
+ request = stub_request "QUERY_STRING" => "format=xml"
789
+
790
+ assert_equal Mime[:xml], request.format
791
+ end
792
+
793
+ test "xhtml format" do
794
+ request = stub_request "QUERY_STRING" => "format=xhtml"
795
+
796
+ assert_equal Mime[:html], request.format
797
+ end
798
+
799
+ test "txt format" do
800
+ request = stub_request "QUERY_STRING" => "format=txt"
801
+
802
+ assert_equal Mime[:text], request.format
803
+ end
804
+
805
+ test "XMLHttpRequest" do
806
+ request = stub_request(
807
+ "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest",
808
+ "HTTP_ACCEPT" => [Mime[:js], Mime[:html], Mime[:xml], "text/xml", "*/*"].join(","),
809
+ "QUERY_STRING" => ""
810
+ )
811
+
812
+ assert_predicate request, :xhr?
813
+ assert_equal Mime[:js], request.format
814
+ end
815
+
816
+ test "can override format with parameter negative" do
817
+ request = stub_request("QUERY_STRING" => "format=txt")
818
+
819
+ assert_not_predicate request.format, :xml?
820
+ end
821
+
822
+ test "can override format with parameter positive" do
823
+ request = stub_request("QUERY_STRING" => "format=xml")
824
+
825
+ assert_predicate request.format, :xml?
826
+ end
827
+
828
+ test "formats text/html with accept header" do
829
+ request = stub_request "HTTP_ACCEPT" => "text/html"
830
+ assert_equal [Mime[:html]], request.formats
831
+ end
832
+
833
+ test "formats blank with accept header" do
834
+ request = stub_request "HTTP_ACCEPT" => ""
835
+ assert_equal [Mime[:html]], request.formats
836
+ end
837
+
838
+ test "formats XMLHttpRequest with accept header" do
839
+ request = stub_request "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest"
840
+ assert_equal [Mime[:js]], request.formats
841
+ end
842
+
843
+ test "formats application/xml with accept header" do
844
+ request = stub_request("CONTENT_TYPE" => "application/xml; charset=UTF-8",
845
+ "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest")
846
+ assert_equal [Mime[:xml]], request.formats
847
+ end
848
+
849
+ test "formats format:text with accept header" do
850
+ request = stub_request("QUERY_STRING" => "format=txt")
851
+
852
+ assert_equal [Mime[:text]], request.formats
853
+ end
854
+
855
+ test "formats format:unknown with accept header" do
856
+ request = stub_request("QUERY_STRING" => "format=unknown")
857
+
858
+ assert_instance_of Mime::NullType, request.format
859
+ end
860
+
861
+ test "format is not nil with unknown format" do
862
+ request = stub_request("QUERY_STRING" => "format=hello")
863
+
864
+ assert_nil request.format
865
+ assert_not_predicate request.format, :html?
866
+ assert_not_predicate request.format, :xml?
867
+ assert_not_predicate request.format, :json?
868
+ end
869
+
870
+ test "format does not throw exceptions when malformed parameters" do
871
+ request = stub_request("QUERY_STRING" => "x[y]=1&x[y][][w]=2")
872
+ assert request.formats
873
+ assert_predicate request.format, :html?
874
+ end
875
+
876
+ test "formats with xhr request" do
877
+ request = stub_request "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest",
878
+ "QUERY_STRING" => ""
879
+
880
+ assert_equal [Mime[:js]], request.formats
881
+ end
882
+
883
+ test "ignore_accept_header" do
884
+ old_ignore_accept_header = ActionDispatch::Request.ignore_accept_header
885
+ ActionDispatch::Request.ignore_accept_header = true
886
+
887
+ begin
888
+ request = stub_request "HTTP_ACCEPT" => "application/xml",
889
+ "QUERY_STRING" => ""
890
+
891
+ assert_equal [ Mime[:html] ], request.formats
892
+
893
+ request = stub_request "HTTP_ACCEPT" => "koz-asked/something-crazy",
894
+ "QUERY_STRING" => ""
895
+
896
+ assert_equal [ Mime[:html] ], request.formats
897
+
898
+ request = stub_request "HTTP_ACCEPT" => "*/*;q=0.1",
899
+ "QUERY_STRING" => ""
900
+
901
+ assert_equal [ Mime[:html] ], request.formats
902
+
903
+ request = stub_request "HTTP_ACCEPT" => "application/jxw",
904
+ "QUERY_STRING" => ""
905
+
906
+ assert_equal [ Mime[:html] ], request.formats
907
+
908
+ request = stub_request "HTTP_ACCEPT" => "application/xml",
909
+ "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest",
910
+ "QUERY_STRING" => ""
911
+
912
+ assert_equal [ Mime[:js] ], request.formats
913
+
914
+ request = stub_request "HTTP_ACCEPT" => "application/xml",
915
+ "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest",
916
+ "QUERY_STRING" => "format=json"
917
+
918
+ assert_equal [ Mime[:json] ], request.formats
919
+ ensure
920
+ ActionDispatch::Request.ignore_accept_header = old_ignore_accept_header
921
+ end
922
+ end
923
+
924
+ test "format taken from the path extension" do
925
+ request = stub_request "PATH_INFO" => "/foo.xml", "QUERY_STRING" => ""
926
+
927
+ assert_equal [Mime[:xml]], request.formats
928
+
929
+ request = stub_request "PATH_INFO" => "/foo.123", "QUERY_STRING" => ""
930
+
931
+ assert_equal [Mime[:html]], request.formats
932
+ end
933
+
934
+ test "formats from accept headers have higher precedence than path extension" do
935
+ request = stub_request "HTTP_ACCEPT" => "application/json",
936
+ "PATH_INFO" => "/foo.xml",
937
+ "QUERY_STRING" => ""
938
+
939
+ assert_equal [Mime[:json]], request.formats
940
+ end
941
+ end
942
+
943
+ class RequestMimeType < BaseRequestTest
944
+ test "content type" do
945
+ assert_equal Mime[:html], stub_request("CONTENT_TYPE" => "text/html").content_mime_type
946
+ end
947
+
948
+ test "no content type" do
949
+ assert_nil stub_request.content_mime_type
950
+ end
951
+
952
+ test "content type is XML" do
953
+ assert_equal Mime[:xml], stub_request("CONTENT_TYPE" => "application/xml").content_mime_type
954
+ end
955
+
956
+ test "content type with charset" do
957
+ assert_equal Mime[:xml], stub_request("CONTENT_TYPE" => "application/xml; charset=UTF-8").content_mime_type
958
+ end
959
+
960
+ test "user agent" do
961
+ assert_equal "TestAgent", stub_request("HTTP_USER_AGENT" => "TestAgent").user_agent
962
+ end
963
+
964
+ test "negotiate_mime" do
965
+ request = stub_request(
966
+ "HTTP_ACCEPT" => "text/html",
967
+ "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest"
968
+ )
969
+
970
+ assert_nil request.negotiate_mime([Mime[:xml], Mime[:json]])
971
+ assert_equal Mime[:html], request.negotiate_mime([Mime[:xml], Mime[:html]])
972
+ assert_equal Mime[:html], request.negotiate_mime([Mime[:xml], Mime::ALL])
973
+ end
974
+
975
+ test "negotiate_mime with content_type" do
976
+ request = stub_request(
977
+ "CONTENT_TYPE" => "application/xml; charset=UTF-8",
978
+ "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest"
979
+ )
980
+
981
+ assert_equal Mime[:xml], request.negotiate_mime([Mime[:xml], Mime[:csv]])
982
+ end
983
+ end
984
+
985
+ class RequestParameters < BaseRequestTest
986
+ test "parameters" do
987
+ request = stub_request "CONTENT_TYPE" => "application/json",
988
+ "CONTENT_LENGTH" => 9,
989
+ "RAW_POST_DATA" => '{"foo":1}',
990
+ "QUERY_STRING" => "bar=2"
991
+
992
+ assert_equal({ "foo" => 1, "bar" => "2" }, request.parameters)
993
+ assert_equal({ "foo" => 1 }, request.request_parameters)
994
+ assert_equal({ "bar" => "2" }, request.query_parameters)
995
+ end
996
+
997
+ test "parameters not accessible after rack parse error" do
998
+ request = stub_request("QUERY_STRING" => "x[y]=1&x[y][][w]=2")
999
+
1000
+ 2.times do
1001
+ assert_raises(ActionController::BadRequest) do
1002
+ # rack will raise a Rack::Utils::ParameterTypeError when parsing this query string
1003
+ request.parameters
1004
+ end
1005
+ end
1006
+ end
1007
+
1008
+ test "path parameters with invalid UTF8 encoding" do
1009
+ request = stub_request
1010
+
1011
+ err = assert_raises(ActionController::BadRequest) do
1012
+ request.path_parameters = { foo: "\xBE" }
1013
+ end
1014
+
1015
+ assert_predicate err.message, :valid_encoding?
1016
+ assert_equal "Invalid path parameters: Invalid encoding for parameter: �", err.message
1017
+ end
1018
+
1019
+ test "parameters not accessible after rack parse error of invalid UTF8 character" do
1020
+ request = stub_request("QUERY_STRING" => "foo%81E=1")
1021
+ assert_raises(ActionController::BadRequest) { request.parameters }
1022
+ end
1023
+
1024
+ test "parameters containing an invalid UTF8 character" do
1025
+ request = stub_request("QUERY_STRING" => "foo=%81E")
1026
+ assert_raises(ActionController::BadRequest) { request.parameters }
1027
+ end
1028
+
1029
+ test "parameters containing a deeply nested invalid UTF8 character" do
1030
+ request = stub_request("QUERY_STRING" => "foo[bar]=%81E")
1031
+ assert_raises(ActionController::BadRequest) { request.parameters }
1032
+ end
1033
+
1034
+ test "parameters not accessible after rack parse error 1" do
1035
+ request = stub_request(
1036
+ "REQUEST_METHOD" => "POST",
1037
+ "CONTENT_LENGTH" => "a%=".length,
1038
+ "CONTENT_TYPE" => "application/x-www-form-urlencoded; charset=utf-8",
1039
+ "rack.input" => StringIO.new("a%=")
1040
+ )
1041
+
1042
+ assert_raises(ActionController::BadRequest) do
1043
+ # rack will raise a Rack::Utils::ParameterTypeError when parsing this query string
1044
+ request.parameters
1045
+ end
1046
+ end
1047
+
1048
+ test "we have access to the original exception" do
1049
+ request = stub_request("QUERY_STRING" => "x[y]=1&x[y][][w]=2")
1050
+
1051
+ e = assert_raises(ActionController::BadRequest) do
1052
+ # rack will raise a Rack::Utils::ParameterTypeError when parsing this query string
1053
+ request.parameters
1054
+ end
1055
+
1056
+ assert_not_nil e.cause
1057
+ assert_equal e.cause.backtrace, e.backtrace
1058
+ end
1059
+ end
1060
+
1061
+ class RequestParameterFilter < BaseRequestTest
1062
+ test "process parameter filter" do
1063
+ test_hashes = [
1064
+ [{ "foo" => "bar" }, { "foo" => "bar" }, %w'food'],
1065
+ [{ "foo" => "bar" }, { "foo" => "[FILTERED]" }, %w'foo'],
1066
+ [{ "foo" => "bar", "bar" => "foo" }, { "foo" => "[FILTERED]", "bar" => "foo" }, %w'foo baz'],
1067
+ [{ "foo" => "bar", "baz" => "foo" }, { "foo" => "[FILTERED]", "baz" => "[FILTERED]" }, %w'foo baz'],
1068
+ [{ "bar" => { "foo" => "bar", "bar" => "foo" } }, { "bar" => { "foo" => "[FILTERED]", "bar" => "foo" } }, %w'fo'],
1069
+ [{ "foo" => { "foo" => "bar", "bar" => "foo" } }, { "foo" => "[FILTERED]" }, %w'f banana'],
1070
+ [{ "deep" => { "cc" => { "code" => "bar", "bar" => "foo" }, "ss" => { "code" => "bar" } } }, { "deep" => { "cc" => { "code" => "[FILTERED]", "bar" => "foo" }, "ss" => { "code" => "bar" } } }, %w'deep.cc.code'],
1071
+ [{ "baz" => [{ "foo" => "baz" }, "1"] }, { "baz" => [{ "foo" => "[FILTERED]" }, "1"] }, [/foo/]]]
1072
+
1073
+ test_hashes.each do |before_filter, after_filter, filter_words|
1074
+ parameter_filter = ActionDispatch::Http::ParameterFilter.new(filter_words)
1075
+ assert_equal after_filter, parameter_filter.filter(before_filter)
1076
+
1077
+ filter_words << "blah"
1078
+ filter_words << lambda { |key, value|
1079
+ value.reverse! if key =~ /bargain/
1080
+ }
1081
+
1082
+ parameter_filter = ActionDispatch::Http::ParameterFilter.new(filter_words)
1083
+ before_filter["barg"] = { :bargain => "gain", "blah" => "bar", "bar" => { "bargain" => { "blah" => "foo" } } }
1084
+ after_filter["barg"] = { :bargain => "niag", "blah" => "[FILTERED]", "bar" => { "bargain" => { "blah" => "[FILTERED]" } } }
1085
+
1086
+ assert_equal after_filter, parameter_filter.filter(before_filter)
1087
+ end
1088
+ end
1089
+
1090
+ test "parameter filter should maintain hash with indifferent access" do
1091
+ test_hashes = [
1092
+ [{ "foo" => "bar" }.with_indifferent_access, ["blah"]],
1093
+ [{ "foo" => "bar" }.with_indifferent_access, []]
1094
+ ]
1095
+
1096
+ test_hashes.each do |before_filter, filter_words|
1097
+ parameter_filter = ActionDispatch::Http::ParameterFilter.new(filter_words)
1098
+ assert_instance_of ActiveSupport::HashWithIndifferentAccess,
1099
+ parameter_filter.filter(before_filter)
1100
+ end
1101
+ end
1102
+
1103
+ test "filtered_parameters returns params filtered" do
1104
+ request = stub_request(
1105
+ "action_dispatch.request.parameters" => {
1106
+ "lifo" => "Pratik",
1107
+ "amount" => "420",
1108
+ "step" => "1"
1109
+ },
1110
+ "action_dispatch.parameter_filter" => [:lifo, :amount]
1111
+ )
1112
+
1113
+ params = request.filtered_parameters
1114
+ assert_equal "[FILTERED]", params["lifo"]
1115
+ assert_equal "[FILTERED]", params["amount"]
1116
+ assert_equal "1", params["step"]
1117
+ end
1118
+
1119
+ test "filtered_env filters env as a whole" do
1120
+ request = stub_request(
1121
+ "action_dispatch.request.parameters" => {
1122
+ "amount" => "420",
1123
+ "step" => "1"
1124
+ },
1125
+ "RAW_POST_DATA" => "yada yada",
1126
+ "action_dispatch.parameter_filter" => [:lifo, :amount]
1127
+ )
1128
+ request = stub_request(request.filtered_env)
1129
+
1130
+ assert_equal "[FILTERED]", request.raw_post
1131
+ assert_equal "[FILTERED]", request.params["amount"]
1132
+ assert_equal "1", request.params["step"]
1133
+ end
1134
+
1135
+ test "filtered_path returns path with filtered query string" do
1136
+ %w(; &).each do |sep|
1137
+ request = stub_request(
1138
+ "QUERY_STRING" => %w(username=sikachu secret=bd4f21f api_key=b1bc3b3cd352f68d79d7).join(sep),
1139
+ "PATH_INFO" => "/authenticate",
1140
+ "action_dispatch.parameter_filter" => [:secret, :api_key]
1141
+ )
1142
+
1143
+ path = request.filtered_path
1144
+ assert_equal %w(/authenticate?username=sikachu secret=[FILTERED] api_key=[FILTERED]).join(sep), path
1145
+ end
1146
+ end
1147
+
1148
+ test "filtered_path should not unescape a genuine '[FILTERED]' value" do
1149
+ request = stub_request(
1150
+ "QUERY_STRING" => "secret=bd4f21f&genuine=%5BFILTERED%5D",
1151
+ "PATH_INFO" => "/authenticate",
1152
+ "action_dispatch.parameter_filter" => [:secret]
1153
+ )
1154
+
1155
+ path = request.filtered_path
1156
+ assert_equal request.script_name + "/authenticate?secret=[FILTERED]&genuine=%5BFILTERED%5D", path
1157
+ end
1158
+
1159
+ test "filtered_path should preserve duplication of keys in query string" do
1160
+ request = stub_request(
1161
+ "QUERY_STRING" => "username=sikachu&secret=bd4f21f&username=fxn",
1162
+ "PATH_INFO" => "/authenticate",
1163
+ "action_dispatch.parameter_filter" => [:secret]
1164
+ )
1165
+
1166
+ path = request.filtered_path
1167
+ assert_equal request.script_name + "/authenticate?username=sikachu&secret=[FILTERED]&username=fxn", path
1168
+ end
1169
+
1170
+ test "filtered_path should ignore searchparts" do
1171
+ request = stub_request(
1172
+ "QUERY_STRING" => "secret",
1173
+ "PATH_INFO" => "/authenticate",
1174
+ "action_dispatch.parameter_filter" => [:secret]
1175
+ )
1176
+
1177
+ path = request.filtered_path
1178
+ assert_equal request.script_name + "/authenticate?secret", path
1179
+ end
1180
+ end
1181
+
1182
+ class RequestEtag < BaseRequestTest
1183
+ test "always matches *" do
1184
+ request = stub_request("HTTP_IF_NONE_MATCH" => "*")
1185
+
1186
+ assert_equal "*", request.if_none_match
1187
+ assert_equal ["*"], request.if_none_match_etags
1188
+
1189
+ assert request.etag_matches?('"strong"')
1190
+ assert request.etag_matches?('W/"weak"')
1191
+ assert_not request.etag_matches?(nil)
1192
+ end
1193
+
1194
+ test "doesn't match absent If-None-Match" do
1195
+ request = stub_request
1196
+
1197
+ assert_nil request.if_none_match
1198
+ assert_equal [], request.if_none_match_etags
1199
+
1200
+ assert_not request.etag_matches?("foo")
1201
+ assert_not request.etag_matches?(nil)
1202
+ end
1203
+
1204
+ test "matches opaque ETag validators without unquoting" do
1205
+ header = '"the-etag"'
1206
+ request = stub_request("HTTP_IF_NONE_MATCH" => header)
1207
+
1208
+ assert_equal header, request.if_none_match
1209
+ assert_equal ['"the-etag"'], request.if_none_match_etags
1210
+
1211
+ assert request.etag_matches?('"the-etag"')
1212
+ assert_not request.etag_matches?("the-etag")
1213
+ end
1214
+
1215
+ test "if_none_match_etags multiple" do
1216
+ header = 'etag1, etag2, "third etag", "etag4"'
1217
+ expected = ["etag1", "etag2", '"third etag"', '"etag4"']
1218
+ request = stub_request("HTTP_IF_NONE_MATCH" => header)
1219
+
1220
+ assert_equal header, request.if_none_match
1221
+ assert_equal expected, request.if_none_match_etags
1222
+ expected.each do |etag|
1223
+ assert request.etag_matches?(etag), etag
1224
+ end
1225
+ end
1226
+ end
1227
+
1228
+ class RequestVariant < BaseRequestTest
1229
+ def setup
1230
+ super
1231
+ @request = stub_request
1232
+ end
1233
+
1234
+ test "setting variant to a symbol" do
1235
+ @request.variant = :phone
1236
+
1237
+ assert_predicate @request.variant, :phone?
1238
+ assert_not_predicate @request.variant, :tablet?
1239
+ assert @request.variant.any?(:phone, :tablet)
1240
+ assert_not @request.variant.any?(:tablet, :desktop)
1241
+ end
1242
+
1243
+ test "setting variant to an array of symbols" do
1244
+ @request.variant = [:phone, :tablet]
1245
+
1246
+ assert_predicate @request.variant, :phone?
1247
+ assert_predicate @request.variant, :tablet?
1248
+ assert_not_predicate @request.variant, :desktop?
1249
+ assert @request.variant.any?(:tablet, :desktop)
1250
+ assert_not @request.variant.any?(:desktop, :watch)
1251
+ end
1252
+
1253
+ test "clearing variant" do
1254
+ @request.variant = nil
1255
+
1256
+ assert_empty @request.variant
1257
+ assert_not_predicate @request.variant, :phone?
1258
+ assert_not @request.variant.any?(:phone, :tablet)
1259
+ end
1260
+
1261
+ test "setting variant to a non-symbol value" do
1262
+ assert_raise ArgumentError do
1263
+ @request.variant = "phone"
1264
+ end
1265
+ end
1266
+
1267
+ test "setting variant to an array containing a non-symbol value" do
1268
+ assert_raise ArgumentError do
1269
+ @request.variant = [:phone, "tablet"]
1270
+ end
1271
+ end
1272
+ end
1273
+
1274
+ class RequestFormData < BaseRequestTest
1275
+ test "media_type is from the FORM_DATA_MEDIA_TYPES array" do
1276
+ assert_predicate stub_request("CONTENT_TYPE" => "application/x-www-form-urlencoded"), :form_data?
1277
+ assert_predicate stub_request("CONTENT_TYPE" => "multipart/form-data"), :form_data?
1278
+ end
1279
+
1280
+ test "media_type is not from the FORM_DATA_MEDIA_TYPES array" do
1281
+ assert_not_predicate stub_request("CONTENT_TYPE" => "application/xml"), :form_data?
1282
+ assert_not_predicate stub_request("CONTENT_TYPE" => "multipart/related"), :form_data?
1283
+ end
1284
+
1285
+ test "no Content-Type header is provided and the request_method is POST" do
1286
+ request = stub_request("REQUEST_METHOD" => "POST")
1287
+
1288
+ assert_equal "", request.media_type
1289
+ assert_equal "POST", request.request_method
1290
+ assert_not_predicate request, :form_data?
1291
+ end
1292
+ end
1293
+
1294
+ class EarlyHintsRequestTest < BaseRequestTest
1295
+ def setup
1296
+ super
1297
+ @env["rack.early_hints"] = lambda { |links| links }
1298
+ @request = stub_request
1299
+ end
1300
+
1301
+ test "when early hints is set in the env link headers are sent" do
1302
+ early_hints = @request.send_early_hints("Link" => "</style.css>; rel=preload; as=style\n</script.js>; rel=preload")
1303
+ expected_hints = { "Link" => "</style.css>; rel=preload; as=style\n</script.js>; rel=preload" }
1304
+
1305
+ assert_equal expected_hints, early_hints
1306
+ end
1307
+ end