actionpack 2.1.2 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of actionpack might be problematic. Click here for more details.

Files changed (200) hide show
  1. data/CHANGELOG +223 -7
  2. data/README +6 -12
  3. data/Rakefile +11 -11
  4. data/lib/action_controller.rb +9 -9
  5. data/lib/action_controller/assertions/response_assertions.rb +29 -78
  6. data/lib/action_controller/assertions/routing_assertions.rb +33 -33
  7. data/lib/action_controller/assertions/selector_assertions.rb +9 -5
  8. data/lib/action_controller/base.rb +227 -161
  9. data/lib/action_controller/benchmarking.rb +37 -24
  10. data/lib/action_controller/caching/actions.rb +53 -21
  11. data/lib/action_controller/caching/fragments.rb +10 -36
  12. data/lib/action_controller/caching/sweeping.rb +3 -3
  13. data/lib/action_controller/cgi_ext/session.rb +2 -22
  14. data/lib/action_controller/cgi_process.rb +8 -46
  15. data/lib/action_controller/components.rb +4 -1
  16. data/lib/action_controller/cookies.rb +10 -0
  17. data/lib/action_controller/dispatcher.rb +49 -15
  18. data/lib/action_controller/filters.rb +48 -10
  19. data/lib/action_controller/headers.rb +16 -14
  20. data/lib/action_controller/helpers.rb +2 -2
  21. data/lib/action_controller/http_authentication.rb +1 -1
  22. data/lib/action_controller/integration.rb +57 -60
  23. data/lib/action_controller/layout.rb +27 -53
  24. data/lib/action_controller/mime_responds.rb +5 -1
  25. data/lib/action_controller/mime_type.rb +64 -42
  26. data/lib/action_controller/mime_types.rb +2 -1
  27. data/lib/action_controller/performance_test.rb +16 -0
  28. data/lib/action_controller/polymorphic_routes.rb +16 -9
  29. data/lib/action_controller/rack_process.rb +303 -0
  30. data/lib/action_controller/request.rb +205 -97
  31. data/lib/action_controller/request_forgery_protection.rb +2 -2
  32. data/lib/action_controller/request_profiler.rb +0 -0
  33. data/lib/action_controller/rescue.rb +20 -115
  34. data/lib/action_controller/resources.rb +186 -83
  35. data/lib/action_controller/response.rb +140 -26
  36. data/lib/action_controller/routing.rb +28 -30
  37. data/lib/action_controller/routing/builder.rb +45 -54
  38. data/lib/action_controller/routing/optimisations.rb +31 -21
  39. data/lib/action_controller/routing/recognition_optimisation.rb +33 -27
  40. data/lib/action_controller/routing/route.rb +162 -147
  41. data/lib/action_controller/routing/route_set.rb +8 -7
  42. data/lib/action_controller/routing/routing_ext.rb +4 -1
  43. data/lib/action_controller/routing/segments.rb +50 -21
  44. data/lib/action_controller/session/cookie_store.rb +3 -2
  45. data/lib/action_controller/session/drb_server.rb +7 -7
  46. data/lib/action_controller/session_management.rb +6 -2
  47. data/lib/action_controller/streaming.rb +15 -8
  48. data/lib/action_controller/templates/rescues/diagnostics.erb +2 -2
  49. data/lib/action_controller/templates/rescues/template_error.erb +2 -2
  50. data/lib/action_controller/test_case.rb +66 -2
  51. data/lib/action_controller/test_process.rb +71 -66
  52. data/lib/action_controller/translation.rb +13 -0
  53. data/lib/action_controller/url_rewriter.rb +90 -13
  54. data/lib/action_controller/vendor/html-scanner/html/node.rb +9 -2
  55. data/lib/action_controller/vendor/html-scanner/html/sanitizer.rb +1 -1
  56. data/lib/action_controller/vendor/html-scanner/html/selector.rb +2 -2
  57. data/lib/action_controller/verification.rb +2 -2
  58. data/lib/action_pack/version.rb +1 -1
  59. data/lib/action_view.rb +19 -11
  60. data/lib/action_view/base.rb +184 -150
  61. data/lib/action_view/helpers.rb +38 -0
  62. data/lib/action_view/helpers/active_record_helper.rb +56 -27
  63. data/lib/action_view/helpers/asset_tag_helper.rb +356 -153
  64. data/lib/action_view/helpers/atom_feed_helper.rb +74 -19
  65. data/lib/action_view/helpers/benchmark_helper.rb +3 -3
  66. data/lib/action_view/helpers/cache_helper.rb +1 -2
  67. data/lib/action_view/helpers/capture_helper.rb +19 -44
  68. data/lib/action_view/helpers/date_helper.rb +486 -296
  69. data/lib/action_view/helpers/debug_helper.rb +20 -13
  70. data/lib/action_view/helpers/form_helper.rb +71 -30
  71. data/lib/action_view/helpers/form_options_helper.rb +15 -85
  72. data/lib/action_view/helpers/form_tag_helper.rb +61 -38
  73. data/lib/action_view/helpers/javascript_helper.rb +80 -89
  74. data/lib/action_view/helpers/number_helper.rb +179 -74
  75. data/lib/action_view/helpers/prototype_helper.rb +216 -201
  76. data/lib/action_view/helpers/record_tag_helper.rb +4 -5
  77. data/lib/action_view/helpers/sanitize_helper.rb +65 -33
  78. data/lib/action_view/helpers/scriptaculous_helper.rb +2 -2
  79. data/lib/action_view/helpers/tag_helper.rb +39 -22
  80. data/lib/action_view/helpers/text_helper.rb +212 -118
  81. data/lib/action_view/helpers/translation_helper.rb +21 -0
  82. data/lib/action_view/helpers/url_helper.rb +100 -58
  83. data/lib/action_view/inline_template.rb +13 -14
  84. data/lib/action_view/locale/en.yml +91 -0
  85. data/lib/action_view/partials.rb +100 -55
  86. data/lib/action_view/paths.rb +125 -0
  87. data/lib/action_view/renderable.rb +102 -0
  88. data/lib/action_view/renderable_partial.rb +48 -0
  89. data/lib/action_view/template.rb +90 -101
  90. data/lib/action_view/template_error.rb +11 -21
  91. data/lib/action_view/template_handler.rb +8 -28
  92. data/lib/action_view/template_handlers.rb +45 -0
  93. data/lib/action_view/template_handlers/builder.rb +5 -15
  94. data/lib/action_view/template_handlers/erb.rb +9 -6
  95. data/lib/action_view/template_handlers/rjs.rb +2 -17
  96. data/lib/action_view/test_case.rb +7 -4
  97. data/test/abstract_unit.rb +4 -1
  98. data/test/active_record_unit.rb +28 -30
  99. data/test/activerecord/render_partial_with_record_identification_test.rb +25 -12
  100. data/test/controller/action_pack_assertions_test.rb +8 -37
  101. data/test/controller/addresses_render_test.rb +0 -3
  102. data/test/controller/assert_select_test.rb +51 -24
  103. data/test/controller/base_test.rb +4 -4
  104. data/test/controller/caching_test.rb +136 -66
  105. data/test/controller/capture_test.rb +1 -21
  106. data/test/controller/cgi_test.rb +157 -10
  107. data/test/controller/components_test.rb +41 -25
  108. data/test/controller/content_type_test.rb +49 -17
  109. data/test/controller/cookie_test.rb +1 -1
  110. data/test/controller/deprecation/deprecated_base_methods_test.rb +0 -3
  111. data/test/controller/dispatcher_test.rb +9 -1
  112. data/test/controller/filter_params_test.rb +2 -2
  113. data/test/controller/filters_test.rb +13 -13
  114. data/test/controller/html-scanner/cdata_node_test.rb +15 -0
  115. data/test/controller/html-scanner/node_test.rb +21 -0
  116. data/test/controller/html-scanner/sanitizer_test.rb +14 -0
  117. data/test/controller/integration_test.rb +167 -6
  118. data/test/controller/layout_test.rb +11 -68
  119. data/test/controller/logging_test.rb +46 -0
  120. data/test/controller/mime_responds_test.rb +61 -59
  121. data/test/controller/mime_type_test.rb +6 -6
  122. data/test/controller/polymorphic_routes_test.rb +37 -2
  123. data/test/controller/rack_test.rb +323 -0
  124. data/test/controller/redirect_test.rb +72 -71
  125. data/test/controller/render_test.rb +1120 -108
  126. data/test/controller/request_forgery_protection_test.rb +66 -52
  127. data/test/controller/request_test.rb +103 -146
  128. data/test/controller/rescue_test.rb +20 -24
  129. data/test/controller/resources_test.rb +408 -25
  130. data/test/controller/routing_test.rb +1774 -1774
  131. data/test/controller/send_file_test.rb +0 -4
  132. data/test/controller/session/cookie_store_test.rb +53 -1
  133. data/test/controller/test_test.rb +15 -37
  134. data/test/controller/translation_test.rb +26 -0
  135. data/test/controller/url_rewriter_test.rb +27 -28
  136. data/test/controller/view_paths_test.rb +48 -47
  137. data/test/fixtures/_top_level_partial.html.erb +1 -0
  138. data/test/fixtures/_top_level_partial_only.erb +1 -0
  139. data/test/fixtures/developers/_developer.erb +1 -0
  140. data/test/fixtures/fun/games/_game.erb +1 -0
  141. data/test/fixtures/fun/serious/games/_game.erb +1 -0
  142. data/test/fixtures/functional_caching/formatted_fragment_cached.html.erb +3 -0
  143. data/test/fixtures/functional_caching/formatted_fragment_cached.js.rjs +6 -0
  144. data/test/fixtures/functional_caching/formatted_fragment_cached.xml.builder +5 -0
  145. data/test/fixtures/functional_caching/inline_fragment_cached.html.erb +2 -0
  146. data/test/fixtures/layouts/_column.html.erb +2 -0
  147. data/test/fixtures/projects/_project.erb +1 -0
  148. data/test/fixtures/public/javascripts/subdir/subdir.js +1 -0
  149. data/test/fixtures/public/stylesheets/subdir/subdir.css +1 -0
  150. data/test/fixtures/replies/_reply.erb +1 -0
  151. data/test/fixtures/test/_counter.html.erb +1 -0
  152. data/test/fixtures/test/_customer.erb +1 -1
  153. data/test/fixtures/test/_customer_with_var.erb +1 -0
  154. data/test/fixtures/test/_layout_for_block_with_args.html.erb +3 -0
  155. data/test/fixtures/test/_local_inspector.html.erb +1 -0
  156. data/test/fixtures/test/_partial_with_only_html_version.html.erb +1 -0
  157. data/test/fixtures/test/hello.builder +1 -1
  158. data/test/fixtures/test/hyphen-ated.erb +1 -0
  159. data/test/fixtures/test/implicit_content_type.atom.builder +2 -0
  160. data/test/fixtures/test/nested_layout.erb +3 -0
  161. data/test/fixtures/test/non_erb_block_content_for.builder +1 -1
  162. data/test/fixtures/test/sub_template_raise.html.erb +1 -0
  163. data/test/fixtures/test/template.erb +1 -0
  164. data/test/fixtures/test/using_layout_around_block_with_args.html.erb +1 -0
  165. data/test/template/active_record_helper_i18n_test.rb +46 -0
  166. data/test/template/active_record_helper_test.rb +24 -24
  167. data/test/template/asset_tag_helper_test.rb +161 -29
  168. data/test/template/atom_feed_helper_test.rb +114 -5
  169. data/test/template/compiled_templates_test.rb +59 -0
  170. data/test/template/date_helper_i18n_test.rb +113 -0
  171. data/test/template/date_helper_test.rb +403 -109
  172. data/test/template/form_helper_test.rb +213 -154
  173. data/test/template/form_options_helper_test.rb +249 -897
  174. data/test/template/form_tag_helper_test.rb +80 -32
  175. data/test/template/javascript_helper_test.rb +17 -18
  176. data/test/template/number_helper_i18n_test.rb +54 -0
  177. data/test/template/number_helper_test.rb +43 -13
  178. data/test/template/prototype_helper_test.rb +101 -84
  179. data/test/template/record_tag_helper_test.rb +24 -20
  180. data/test/template/render_test.rb +193 -0
  181. data/test/template/sanitize_helper_test.rb +3 -3
  182. data/test/template/tag_helper_test.rb +34 -14
  183. data/test/template/text_helper_test.rb +83 -9
  184. data/test/template/translation_helper_test.rb +28 -0
  185. data/test/template/url_helper_test.rb +55 -18
  186. metadata +57 -18
  187. data/lib/action_view/helpers/javascripts/controls.js +0 -963
  188. data/lib/action_view/helpers/javascripts/dragdrop.js +0 -972
  189. data/lib/action_view/helpers/javascripts/effects.js +0 -1120
  190. data/lib/action_view/helpers/javascripts/prototype.js +0 -4225
  191. data/lib/action_view/partial_template.rb +0 -70
  192. data/lib/action_view/template_finder.rb +0 -177
  193. data/lib/action_view/template_handlers/compilable.rb +0 -128
  194. data/test/controller/custom_handler_test.rb +0 -45
  195. data/test/controller/new_render_test.rb +0 -945
  196. data/test/fixtures/test/block_content_for.erb +0 -2
  197. data/test/fixtures/test/erb_content_for.erb +0 -2
  198. data/test/template/deprecated_erb_variable_test.rb +0 -9
  199. data/test/template/template_finder_test.rb +0 -73
  200. data/test/template/template_object_test.rb +0 -95
@@ -0,0 +1,28 @@
1
+ require 'abstract_unit'
2
+
3
+ class TranslationHelperTest < Test::Unit::TestCase
4
+ include ActionView::Helpers::TagHelper
5
+ include ActionView::Helpers::TranslationHelper
6
+
7
+ attr_reader :request
8
+ uses_mocha 'translation_helper_test' do
9
+ def setup
10
+ end
11
+
12
+ def test_delegates_to_i18n_setting_the_raise_option
13
+ I18n.expects(:translate).with(:foo, :locale => 'en', :raise => true)
14
+ translate :foo, :locale => 'en'
15
+ end
16
+
17
+ def test_returns_missing_translation_message_wrapped_into_span
18
+ expected = '<span class="translation_missing">en, foo</span>'
19
+ assert_equal expected, translate(:foo)
20
+ end
21
+
22
+ def test_delegates_localize_to_i18n
23
+ @time = Time.utc(2008, 7, 8, 12, 18, 38)
24
+ I18n.expects(:localize).with(@time)
25
+ localize @time
26
+ end
27
+ end
28
+ end
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  require 'abstract_unit'
2
3
 
3
4
  RequestMock = Struct.new("Request", :request_uri, :protocol, :host_with_port, :env)
@@ -28,6 +29,16 @@ class UrlHelperTest < ActionView::TestCase
28
29
  assert_equal "http://www.example.com?a=b&amp;c=d", url_for("http://www.example.com?a=b&amp;c=d")
29
30
  end
30
31
 
32
+ def test_url_for_with_back
33
+ @controller.request = RequestMock.new("http://www.example.com/weblog/show", nil, nil, {'HTTP_REFERER' => 'http://www.example.com/referer'})
34
+ assert_equal 'http://www.example.com/referer', url_for(:back)
35
+ end
36
+
37
+ def test_url_for_with_back_and_no_referer
38
+ @controller.request = RequestMock.new("http://www.example.com/weblog/show", nil, nil, {})
39
+ assert_equal 'javascript:history.back()', url_for(:back)
40
+ end
41
+
31
42
  # todo: missing test cases
32
43
  def test_button_to_with_straight_url
33
44
  assert_dom_equal "<form method=\"post\" action=\"http://www.example.com\" class=\"button-to\"><div><input type=\"submit\" value=\"Hello\" /></div></form>", button_to("Hello", "http://www.example.com")
@@ -80,7 +91,7 @@ class UrlHelperTest < ActionView::TestCase
80
91
  def test_link_tag_with_straight_url
81
92
  assert_dom_equal "<a href=\"http://www.example.com\">Hello</a>", link_to("Hello", "http://www.example.com")
82
93
  end
83
-
94
+
84
95
  def test_link_tag_without_host_option
85
96
  ActionController::Base.class_eval { attr_accessor :url }
86
97
  url = {:controller => 'weblog', :action => 'show'}
@@ -121,7 +132,7 @@ class UrlHelperTest < ActionView::TestCase
121
132
  @controller.request = RequestMock.new("http://www.example.com/weblog/show", nil, nil, {'HTTP_REFERER' => 'http://www.example.com/referer'})
122
133
  assert_dom_equal "<a href=\"http://www.example.com/referer\">go back</a>", link_to('go back', :back)
123
134
  end
124
-
135
+
125
136
  def test_link_tag_with_back_and_no_referer
126
137
  @controller.request = RequestMock.new("http://www.example.com/weblog/show", nil, nil, {})
127
138
  assert_dom_equal "<a href=\"javascript:history.back()\">go back</a>", link_to('go back', :back)
@@ -211,7 +222,15 @@ class UrlHelperTest < ActionView::TestCase
211
222
  def test_link_tag_using_post_javascript_and_popup
212
223
  assert_raises(ActionView::ActionViewError) { link_to("Hello", "http://www.example.com", :popup => true, :method => :post, :confirm => "Are you serious?") }
213
224
  end
214
-
225
+
226
+ def test_link_tag_using_block_in_erb
227
+ __in_erb_template = ''
228
+
229
+ link_to("http://example.com") { concat("Example site") }
230
+
231
+ assert_equal '<a href="http://example.com">Example site</a>', output_buffer
232
+ end
233
+
215
234
  def test_link_to_unless
216
235
  assert_equal "Showing", link_to_unless(true, "Showing", :action => "show", :controller => "weblog")
217
236
  assert_dom_equal "<a href=\"http://www.example.com\">Listing</a>", link_to_unless(false, "Listing", :action => "list", :controller => "weblog")
@@ -239,6 +258,16 @@ class UrlHelperTest < ActionView::TestCase
239
258
  assert_equal "Showing", link_to_unless_current("Showing", { :action => "show", :controller => "weblog" })
240
259
  assert_equal "Showing", link_to_unless_current("Showing", "http://www.example.com/weblog/show")
241
260
 
261
+ @controller.request = RequestMock.new("http://www.example.com/weblog/show?order=desc")
262
+ @controller.url = "http://www.example.com/weblog/show"
263
+ assert_equal "Showing", link_to_unless_current("Showing", { :action => "show", :controller => "weblog" })
264
+ assert_equal "Showing", link_to_unless_current("Showing", "http://www.example.com/weblog/show")
265
+
266
+ @controller.request = RequestMock.new("http://www.example.com/weblog/show?order=desc")
267
+ @controller.url = "http://www.example.com/weblog/show?order=asc"
268
+ assert_equal "<a href=\"http://www.example.com/weblog/show?order=asc\">Showing</a>", link_to_unless_current("Showing", { :action => "show", :controller => "weblog" })
269
+ assert_equal "<a href=\"http://www.example.com/weblog/show?order=asc\">Showing</a>", link_to_unless_current("Showing", "http://www.example.com/weblog/show?order=asc")
270
+
242
271
  @controller.request = RequestMock.new("http://www.example.com/weblog/show")
243
272
  @controller.url = "http://www.example.com/weblog/list"
244
273
  assert_equal "<a href=\"http://www.example.com/weblog/list\">Listing</a>",
@@ -259,7 +288,11 @@ class UrlHelperTest < ActionView::TestCase
259
288
  end
260
289
 
261
290
  def test_mail_to_with_javascript
262
- assert_dom_equal "<script type=\"text/javascript\">eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%64%6f%6d%61%69%6e%2e%63%6f%6d%22%3e%4d%79%20%65%6d%61%69%6c%3c%2f%61%3e%27%29%3b'))</script>", mail_to("me@domain.com", "My email", :encode => "javascript")
291
+ assert_dom_equal "<script type=\"text/javascript\">eval(decodeURIComponent('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%64%6f%6d%61%69%6e%2e%63%6f%6d%22%3e%4d%79%20%65%6d%61%69%6c%3c%2f%61%3e%27%29%3b'))</script>", mail_to("me@domain.com", "My email", :encode => "javascript")
292
+ end
293
+
294
+ def test_mail_to_with_javascript_unicode
295
+ assert_dom_equal "<script type=\"text/javascript\">eval(decodeURIComponent('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%75%6e%69%63%6f%64%65%40%65%78%61%6d%70%6c%65%2e%63%6f%6d%22%3e%c3%ba%6e%69%63%6f%64%65%3c%2f%61%3e%27%29%3b'))</script>", mail_to("unicode@example.com", "únicode", :encode => "javascript")
263
296
  end
264
297
 
265
298
  def test_mail_with_options
@@ -283,10 +316,10 @@ class UrlHelperTest < ActionView::TestCase
283
316
  assert_dom_equal "<a href=\"&#109;&#97;&#105;&#108;&#116;&#111;&#58;%6d%65@%64%6f%6d%61%69%6e.%63%6f%6d\">&#109;&#101;&#40;&#97;&#116;&#41;&#100;&#111;&#109;&#97;&#105;&#110;&#46;&#99;&#111;&#109;</a>", mail_to("me@domain.com", nil, :encode => "hex", :replace_at => "(at)")
284
317
  assert_dom_equal "<a href=\"&#109;&#97;&#105;&#108;&#116;&#111;&#58;%6d%65@%64%6f%6d%61%69%6e.%63%6f%6d\">My email</a>", mail_to("me@domain.com", "My email", :encode => "hex", :replace_at => "(at)")
285
318
  assert_dom_equal "<a href=\"&#109;&#97;&#105;&#108;&#116;&#111;&#58;%6d%65@%64%6f%6d%61%69%6e.%63%6f%6d\">&#109;&#101;&#40;&#97;&#116;&#41;&#100;&#111;&#109;&#97;&#105;&#110;&#40;&#100;&#111;&#116;&#41;&#99;&#111;&#109;</a>", mail_to("me@domain.com", nil, :encode => "hex", :replace_at => "(at)", :replace_dot => "(dot)")
286
- assert_dom_equal "<script type=\"text/javascript\">eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%64%6f%6d%61%69%6e%2e%63%6f%6d%22%3e%4d%79%20%65%6d%61%69%6c%3c%2f%61%3e%27%29%3b'))</script>", mail_to("me@domain.com", "My email", :encode => "javascript", :replace_at => "(at)", :replace_dot => "(dot)")
287
- assert_dom_equal "<script type=\"text/javascript\">eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%64%6f%6d%61%69%6e%2e%63%6f%6d%22%3e%6d%65%28%61%74%29%64%6f%6d%61%69%6e%28%64%6f%74%29%63%6f%6d%3c%2f%61%3e%27%29%3b'))</script>", mail_to("me@domain.com", nil, :encode => "javascript", :replace_at => "(at)", :replace_dot => "(dot)")
319
+ assert_dom_equal "<script type=\"text/javascript\">eval(decodeURIComponent('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%64%6f%6d%61%69%6e%2e%63%6f%6d%22%3e%4d%79%20%65%6d%61%69%6c%3c%2f%61%3e%27%29%3b'))</script>", mail_to("me@domain.com", "My email", :encode => "javascript", :replace_at => "(at)", :replace_dot => "(dot)")
320
+ assert_dom_equal "<script type=\"text/javascript\">eval(decodeURIComponent('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%64%6f%6d%61%69%6e%2e%63%6f%6d%22%3e%6d%65%28%61%74%29%64%6f%6d%61%69%6e%28%64%6f%74%29%63%6f%6d%3c%2f%61%3e%27%29%3b'))</script>", mail_to("me@domain.com", nil, :encode => "javascript", :replace_at => "(at)", :replace_dot => "(dot)")
288
321
  end
289
-
322
+
290
323
  def protect_against_forgery?
291
324
  false
292
325
  end
@@ -294,8 +327,6 @@ end
294
327
 
295
328
  class UrlHelperWithControllerTest < ActionView::TestCase
296
329
  class UrlHelperController < ActionController::Base
297
- self.view_paths = [ "#{File.dirname(__FILE__)}/../fixtures/" ]
298
-
299
330
  def self.controller_path; 'url_helper_with_controller' end
300
331
 
301
332
  def show_url_for
@@ -345,6 +376,19 @@ class UrlHelperWithControllerTest < ActionView::TestCase
345
376
  assert_equal '/url_helper_with_controller/nil_url_for', @response.body
346
377
  end
347
378
 
379
+ def test_named_route_should_show_host_and_path_using_controller_default_url_options
380
+ class << @controller
381
+ def default_url_options(options = nil)
382
+ {:host => 'testtwo.host'}
383
+ end
384
+ end
385
+
386
+ with_url_helper_routing do
387
+ get :show_named_route, :kind => 'url'
388
+ assert_equal 'http://testtwo.host/url_helper_with_controller/show_named_route', @response.body
389
+ end
390
+ end
391
+
348
392
  protected
349
393
  def with_url_helper_routing
350
394
  with_routing do |set|
@@ -358,8 +402,6 @@ end
358
402
 
359
403
  class LinkToUnlessCurrentWithControllerTest < ActionView::TestCase
360
404
  class TasksController < ActionController::Base
361
- self.view_paths = ["#{File.dirname(__FILE__)}/../fixtures/"]
362
-
363
405
  def self.controller_path; 'tasks' end
364
406
 
365
407
  def index
@@ -415,18 +457,17 @@ class LinkToUnlessCurrentWithControllerTest < ActionView::TestCase
415
457
  end
416
458
  end
417
459
 
418
-
419
460
  class Workshop
420
461
  attr_accessor :id, :new_record
421
462
 
422
463
  def initialize(id, new_record)
423
464
  @id, @new_record = id, new_record
424
465
  end
425
-
466
+
426
467
  def new_record?
427
468
  @new_record
428
469
  end
429
-
470
+
430
471
  def to_s
431
472
  id.to_s
432
473
  end
@@ -450,8 +491,6 @@ end
450
491
 
451
492
  class PolymorphicControllerTest < ActionView::TestCase
452
493
  class WorkshopsController < ActionController::Base
453
- self.view_paths = ["#{File.dirname(__FILE__)}/../fixtures/"]
454
-
455
494
  def self.controller_path; 'workshops' end
456
495
 
457
496
  def index
@@ -468,8 +507,6 @@ class PolymorphicControllerTest < ActionView::TestCase
468
507
  end
469
508
 
470
509
  class SessionsController < ActionController::Base
471
- self.view_paths = ["#{File.dirname(__FILE__)}/../fixtures/"]
472
-
473
510
  def self.controller_path; 'sessions' end
474
511
 
475
512
  def index
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -9,7 +9,7 @@ autorequire: action_controller
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-10-23 00:00:00 +02:00
12
+ date: 2008-11-20 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - "="
22
22
  - !ruby/object:Gem::Version
23
- version: 2.1.2
23
+ version: 2.2.2
24
24
  version:
25
25
  description: Eases web-request routing, handling, and response as a half-way front, half-way page controller. Implemented with specific emphasis on enabling easy unit/integration testing that doesn't require a browser.
26
26
  email: david@loudthinking.com
@@ -75,7 +75,9 @@ files:
75
75
  - lib/action_controller/mime_responds.rb
76
76
  - lib/action_controller/mime_type.rb
77
77
  - lib/action_controller/mime_types.rb
78
+ - lib/action_controller/performance_test.rb
78
79
  - lib/action_controller/polymorphic_routes.rb
80
+ - lib/action_controller/rack_process.rb
79
81
  - lib/action_controller/record_identifier.rb
80
82
  - lib/action_controller/request.rb
81
83
  - lib/action_controller/request_forgery_protection.rb
@@ -113,6 +115,7 @@ files:
113
115
  - lib/action_controller/templates/rescues/unknown_action.erb
114
116
  - lib/action_controller/test_case.rb
115
117
  - lib/action_controller/test_process.rb
118
+ - lib/action_controller/translation.rb
116
119
  - lib/action_controller/url_rewriter.rb
117
120
  - lib/action_controller/vendor
118
121
  - lib/action_controller/vendor/html-scanner
@@ -144,10 +147,6 @@ files:
144
147
  - lib/action_view/helpers/form_tag_helper.rb
145
148
  - lib/action_view/helpers/javascript_helper.rb
146
149
  - lib/action_view/helpers/javascripts
147
- - lib/action_view/helpers/javascripts/controls.js
148
- - lib/action_view/helpers/javascripts/dragdrop.js
149
- - lib/action_view/helpers/javascripts/effects.js
150
- - lib/action_view/helpers/javascripts/prototype.js
151
150
  - lib/action_view/helpers/number_helper.rb
152
151
  - lib/action_view/helpers/prototype_helper.rb
153
152
  - lib/action_view/helpers/record_identification_helper.rb
@@ -156,19 +155,24 @@ files:
156
155
  - lib/action_view/helpers/scriptaculous_helper.rb
157
156
  - lib/action_view/helpers/tag_helper.rb
158
157
  - lib/action_view/helpers/text_helper.rb
158
+ - lib/action_view/helpers/translation_helper.rb
159
159
  - lib/action_view/helpers/url_helper.rb
160
+ - lib/action_view/helpers.rb
160
161
  - lib/action_view/inline_template.rb
161
- - lib/action_view/partial_template.rb
162
+ - lib/action_view/locale
163
+ - lib/action_view/locale/en.yml
162
164
  - lib/action_view/partials.rb
165
+ - lib/action_view/paths.rb
166
+ - lib/action_view/renderable.rb
167
+ - lib/action_view/renderable_partial.rb
163
168
  - lib/action_view/template.rb
164
169
  - lib/action_view/template_error.rb
165
- - lib/action_view/template_finder.rb
166
170
  - lib/action_view/template_handler.rb
167
171
  - lib/action_view/template_handlers
168
172
  - lib/action_view/template_handlers/builder.rb
169
- - lib/action_view/template_handlers/compilable.rb
170
173
  - lib/action_view/template_handlers/erb.rb
171
174
  - lib/action_view/template_handlers/rjs.rb
175
+ - lib/action_view/template_handlers.rb
172
176
  - lib/action_view/test_case.rb
173
177
  - lib/action_view.rb
174
178
  - lib/actionpack.rb
@@ -201,7 +205,6 @@ files:
201
205
  - test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib
202
206
  - test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib/plugin_controller.rb
203
207
  - test/controller/cookie_test.rb
204
- - test/controller/custom_handler_test.rb
205
208
  - test/controller/deprecation
206
209
  - test/controller/deprecation/deprecated_base_methods_test.rb
207
210
  - test/controller/dispatcher_test.rb
@@ -213,6 +216,7 @@ files:
213
216
  - test/controller/header_test.rb
214
217
  - test/controller/helper_test.rb
215
218
  - test/controller/html-scanner
219
+ - test/controller/html-scanner/cdata_node_test.rb
216
220
  - test/controller/html-scanner/document_test.rb
217
221
  - test/controller/html-scanner/node_test.rb
218
222
  - test/controller/html-scanner/sanitizer_test.rb
@@ -223,10 +227,11 @@ files:
223
227
  - test/controller/integration_test.rb
224
228
  - test/controller/integration_upload_test.rb
225
229
  - test/controller/layout_test.rb
230
+ - test/controller/logging_test.rb
226
231
  - test/controller/mime_responds_test.rb
227
232
  - test/controller/mime_type_test.rb
228
- - test/controller/new_render_test.rb
229
233
  - test/controller/polymorphic_routes_test.rb
234
+ - test/controller/rack_test.rb
230
235
  - test/controller/record_identifier_test.rb
231
236
  - test/controller/redirect_test.rb
232
237
  - test/controller/render_test.rb
@@ -243,11 +248,14 @@ files:
243
248
  - test/controller/session_fixation_test.rb
244
249
  - test/controller/session_management_test.rb
245
250
  - test/controller/test_test.rb
251
+ - test/controller/translation_test.rb
246
252
  - test/controller/url_rewriter_test.rb
247
253
  - test/controller/verification_test.rb
248
254
  - test/controller/view_paths_test.rb
249
255
  - test/controller/webservice_test.rb
250
256
  - test/fixtures
257
+ - test/fixtures/_top_level_partial.html.erb
258
+ - test/fixtures/_top_level_partial_only.erb
251
259
  - test/fixtures/addresses
252
260
  - test/fixtures/addresses/list.erb
253
261
  - test/fixtures/bad_customers
@@ -264,15 +272,25 @@ files:
264
272
  - test/fixtures/db_definitions
265
273
  - test/fixtures/db_definitions/sqlite.sql
266
274
  - test/fixtures/developer.rb
275
+ - test/fixtures/developers
276
+ - test/fixtures/developers/_developer.erb
267
277
  - test/fixtures/developers.yml
268
278
  - test/fixtures/developers_projects.yml
269
279
  - test/fixtures/fun
270
280
  - test/fixtures/fun/games
281
+ - test/fixtures/fun/games/_game.erb
271
282
  - test/fixtures/fun/games/hello_world.erb
283
+ - test/fixtures/fun/serious
284
+ - test/fixtures/fun/serious/games
285
+ - test/fixtures/fun/serious/games/_game.erb
272
286
  - test/fixtures/functional_caching
273
287
  - test/fixtures/functional_caching/_partial.erb
288
+ - test/fixtures/functional_caching/formatted_fragment_cached.html.erb
289
+ - test/fixtures/functional_caching/formatted_fragment_cached.js.rjs
290
+ - test/fixtures/functional_caching/formatted_fragment_cached.xml.builder
274
291
  - test/fixtures/functional_caching/fragment_cached.html.erb
275
292
  - test/fixtures/functional_caching/html_fragment_cached_with_partial.html.erb
293
+ - test/fixtures/functional_caching/inline_fragment_cached.html.erb
276
294
  - test/fixtures/functional_caching/js_fragment_cached_with_partial.js.rjs
277
295
  - test/fixtures/good_customers
278
296
  - test/fixtures/good_customers/_good_customer.html.erb
@@ -295,6 +313,7 @@ files:
295
313
  - test/fixtures/layout_tests/views
296
314
  - test/fixtures/layout_tests/views/hello.rhtml
297
315
  - test/fixtures/layouts
316
+ - test/fixtures/layouts/_column.html.erb
298
317
  - test/fixtures/layouts/block_with_layout.erb
299
318
  - test/fixtures/layouts/builder.builder
300
319
  - test/fixtures/layouts/partial_with_layout.erb
@@ -332,6 +351,8 @@ files:
332
351
  - test/fixtures/post_test/super_post/index.html.erb
333
352
  - test/fixtures/post_test/super_post/index.iphone.erb
334
353
  - test/fixtures/project.rb
354
+ - test/fixtures/projects
355
+ - test/fixtures/projects/_project.erb
335
356
  - test/fixtures/projects.yml
336
357
  - test/fixtures/public
337
358
  - test/fixtures/public/404.html
@@ -347,11 +368,17 @@ files:
347
368
  - test/fixtures/public/javascripts/effects.js
348
369
  - test/fixtures/public/javascripts/prototype.js
349
370
  - test/fixtures/public/javascripts/robber.js
371
+ - test/fixtures/public/javascripts/subdir
372
+ - test/fixtures/public/javascripts/subdir/subdir.js
350
373
  - test/fixtures/public/javascripts/version.1.0.js
351
374
  - test/fixtures/public/stylesheets
352
375
  - test/fixtures/public/stylesheets/bank.css
353
376
  - test/fixtures/public/stylesheets/robber.css
377
+ - test/fixtures/public/stylesheets/subdir
378
+ - test/fixtures/public/stylesheets/subdir/subdir.css
354
379
  - test/fixtures/public/stylesheets/version.1.0.css
380
+ - test/fixtures/replies
381
+ - test/fixtures/replies/_reply.erb
355
382
  - test/fixtures/replies.yml
356
383
  - test/fixtures/reply.rb
357
384
  - test/fixtures/respond_to
@@ -377,24 +404,28 @@ files:
377
404
  - test/fixtures/symlink_parent
378
405
  - test/fixtures/symlink_parent/symlinked_layout.erb
379
406
  - test/fixtures/test
407
+ - test/fixtures/test/_counter.html.erb
380
408
  - test/fixtures/test/_customer.erb
381
409
  - test/fixtures/test/_customer_counter.erb
382
410
  - test/fixtures/test/_customer_greeting.erb
411
+ - test/fixtures/test/_customer_with_var.erb
383
412
  - test/fixtures/test/_form.erb
384
413
  - test/fixtures/test/_hash_greeting.erb
385
414
  - test/fixtures/test/_hash_object.erb
386
415
  - test/fixtures/test/_hello.builder
387
416
  - test/fixtures/test/_labelling_form.erb
417
+ - test/fixtures/test/_layout_for_block_with_args.html.erb
388
418
  - test/fixtures/test/_layout_for_partial.html.erb
419
+ - test/fixtures/test/_local_inspector.html.erb
389
420
  - test/fixtures/test/_partial.erb
390
421
  - test/fixtures/test/_partial.html.erb
391
422
  - test/fixtures/test/_partial.js.erb
392
423
  - test/fixtures/test/_partial_for_use_in_layout.html.erb
393
424
  - test/fixtures/test/_partial_only.erb
425
+ - test/fixtures/test/_partial_with_only_html_version.html.erb
394
426
  - test/fixtures/test/_person.erb
395
427
  - test/fixtures/test/_raise.html.erb
396
428
  - test/fixtures/test/action_talk_to_layout.erb
397
- - test/fixtures/test/block_content_for.erb
398
429
  - test/fixtures/test/calling_partial_with_layout.html.erb
399
430
  - test/fixtures/test/capturing.erb
400
431
  - test/fixtures/test/content_for.erb
@@ -404,7 +435,6 @@ files:
404
435
  - test/fixtures/test/dot.directory
405
436
  - test/fixtures/test/dot.directory/render_file_with_ivar.erb
406
437
  - test/fixtures/test/enum_rjs_test.rjs
407
- - test/fixtures/test/erb_content_for.erb
408
438
  - test/fixtures/test/formatted_html_erb.html.erb
409
439
  - test/fixtures/test/formatted_xml_erb.builder
410
440
  - test/fixtures/test/formatted_xml_erb.html.erb
@@ -417,41 +447,50 @@ files:
417
447
  - test/fixtures/test/hello_world_from_rxml.builder
418
448
  - test/fixtures/test/hello_world_with_layout_false.erb
419
449
  - test/fixtures/test/hello_xml_world.builder
450
+ - test/fixtures/test/hyphen-ated.erb
451
+ - test/fixtures/test/implicit_content_type.atom.builder
420
452
  - test/fixtures/test/list.erb
453
+ - test/fixtures/test/nested_layout.erb
421
454
  - test/fixtures/test/non_erb_block_content_for.builder
422
455
  - test/fixtures/test/potential_conflicts.erb
423
456
  - test/fixtures/test/render_file_from_template.html.erb
424
457
  - test/fixtures/test/render_file_with_ivar.erb
425
458
  - test/fixtures/test/render_file_with_locals.erb
426
459
  - test/fixtures/test/render_to_string_test.erb
460
+ - test/fixtures/test/sub_template_raise.html.erb
461
+ - test/fixtures/test/template.erb
427
462
  - test/fixtures/test/update_element_with_capture.erb
428
463
  - test/fixtures/test/using_layout_around_block.html.erb
464
+ - test/fixtures/test/using_layout_around_block_with_args.html.erb
429
465
  - test/fixtures/topic.rb
430
466
  - test/fixtures/topics
431
467
  - test/fixtures/topics/_topic.html.erb
432
468
  - test/fixtures/topics.yml
433
469
  - test/template
470
+ - test/template/active_record_helper_i18n_test.rb
434
471
  - test/template/active_record_helper_test.rb
435
472
  - test/template/asset_tag_helper_test.rb
436
473
  - test/template/atom_feed_helper_test.rb
437
474
  - test/template/benchmark_helper_test.rb
475
+ - test/template/compiled_templates_test.rb
476
+ - test/template/date_helper_i18n_test.rb
438
477
  - test/template/date_helper_test.rb
439
- - test/template/deprecated_erb_variable_test.rb
440
478
  - test/template/erb_util_test.rb
441
479
  - test/template/form_helper_test.rb
442
480
  - test/template/form_options_helper_test.rb
443
481
  - test/template/form_tag_helper_test.rb
444
482
  - test/template/javascript_helper_test.rb
483
+ - test/template/number_helper_i18n_test.rb
445
484
  - test/template/number_helper_test.rb
446
485
  - test/template/prototype_helper_test.rb
447
486
  - test/template/record_tag_helper_test.rb
487
+ - test/template/render_test.rb
448
488
  - test/template/sanitize_helper_test.rb
449
489
  - test/template/scriptaculous_helper_test.rb
450
490
  - test/template/tag_helper_test.rb
451
- - test/template/template_finder_test.rb
452
- - test/template/template_object_test.rb
453
491
  - test/template/test_test.rb
454
492
  - test/template/text_helper_test.rb
493
+ - test/template/translation_helper_test.rb
455
494
  - test/template/url_helper_test.rb
456
495
  - test/testing_sandbox.rb
457
496
  has_rdoc: true
@@ -476,7 +515,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
476
515
  requirements:
477
516
  - none
478
517
  rubyforge_project: actionpack
479
- rubygems_version: 1.3.0
518
+ rubygems_version: 1.3.1
480
519
  signing_key:
481
520
  specification_version: 2
482
521
  summary: Web-flow and rendering framework putting the VC in MVC.