radiant 0.6.3 → 0.6.4

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

Potentially problematic release.


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

Files changed (197) hide show
  1. data/CHANGELOG +61 -7
  2. data/CONTRIBUTORS +15 -0
  3. data/app/controllers/admin/export_controller.rb +1 -1
  4. data/app/controllers/admin/page_controller.rb +1 -0
  5. data/app/controllers/admin/user_controller.rb +2 -1
  6. data/app/controllers/application.rb +7 -8
  7. data/app/helpers/admin/node_helper.rb +84 -0
  8. data/app/helpers/admin/page_helper.rb +1 -19
  9. data/app/helpers/application_helper.rb +15 -9
  10. data/app/models/file_not_found_page.rb +2 -2
  11. data/app/models/page.rb +22 -18
  12. data/app/models/page_context.rb +9 -0
  13. data/app/models/radiant/config.rb +4 -2
  14. data/app/models/response_cache.rb +18 -12
  15. data/app/models/standard_tags.rb +111 -50
  16. data/app/views/admin/extension/index.rhtml +2 -2
  17. data/app/views/admin/layout/edit.rhtml +2 -2
  18. data/app/views/admin/layout/remove.rhtml +2 -2
  19. data/app/views/admin/page/_node.rhtml +4 -26
  20. data/app/views/admin/page/_part.rhtml +9 -14
  21. data/app/views/admin/page/edit.rhtml +38 -121
  22. data/app/views/admin/page/index.rhtml +2 -6
  23. data/app/views/admin/page/remove.rhtml +2 -2
  24. data/app/views/admin/snippet/edit.rhtml +3 -3
  25. data/app/views/admin/snippet/index.rhtml +2 -2
  26. data/app/views/admin/snippet/remove.rhtml +2 -2
  27. data/app/views/admin/user/edit.rhtml +4 -4
  28. data/app/views/admin/user/preferences.rhtml +2 -2
  29. data/app/views/admin/welcome/login.rhtml +1 -1
  30. data/config/environment.rb +79 -78
  31. data/db/schema.rb +2 -0
  32. data/lib/local_time.rb +12 -0
  33. data/lib/plugins/extension_patches/lib/fixture_loading_extension.rb +1 -1
  34. data/lib/plugins/extension_patches/lib/mailer_view_paths_extension.rb +3 -3
  35. data/lib/radiant.rb +1 -1
  36. data/lib/radiant/extension.rb +9 -3
  37. data/lib/radiant/extension_loader.rb +2 -2
  38. data/lib/tasks/extensions.rake +23 -8
  39. data/public/javascripts/admin.js +89 -0
  40. data/public/javascripts/controls.js +486 -354
  41. data/public/javascripts/dragdrop.js +90 -58
  42. data/public/javascripts/effects.js +398 -364
  43. data/public/javascripts/pngfix.js +37 -37
  44. data/public/javascripts/prototype.js +2764 -1095
  45. data/public/javascripts/ruledtable.js +10 -25
  46. data/public/javascripts/sitemap.js +74 -112
  47. data/public/javascripts/string.js +1 -7
  48. data/public/javascripts/tabcontrol.js +71 -86
  49. data/public/javascripts/tag_reference_search.js +19 -26
  50. data/public/stylesheets/admin/main.css +11 -5
  51. data/test/fixtures/extensions/01_basic/lib/new_module.rb +2 -0
  52. data/test/fixtures/page_parts.yml +16 -1
  53. data/test/fixtures/pages.yml +47 -84
  54. data/test/functional/extension_initialization_test.rb +11 -0
  55. data/test/helpers/login_test_helper.rb +12 -1
  56. data/test/helpers/page_test_helper.rb +6 -0
  57. data/test/helpers/render_test_helper.rb +11 -8
  58. data/test/test_helper.rb +1 -12
  59. data/test/unit/file_not_found_page_test.rb +5 -1
  60. data/test/unit/local_time_test.rb +45 -0
  61. data/test/unit/page_context_test.rb +32 -1
  62. data/test/unit/page_test.rb +45 -11
  63. data/test/unit/radiant/config_test.rb +1 -1
  64. data/test/unit/response_cache_test.rb +27 -2
  65. data/test/unit/standard_tags_test.rb +60 -15
  66. data/vendor/extensions/archive/README +29 -0
  67. data/vendor/extensions/archive/Rakefile +25 -0
  68. data/{app → vendor/extensions/archive/app}/models/archive_day_index_page.rb +0 -0
  69. data/{app → vendor/extensions/archive/app}/models/archive_finder.rb +8 -6
  70. data/{app → vendor/extensions/archive/app}/models/archive_month_index_page.rb +0 -0
  71. data/{app → vendor/extensions/archive/app}/models/archive_page.rb +0 -0
  72. data/{app → vendor/extensions/archive/app}/models/archive_year_index_page.rb +0 -0
  73. data/vendor/extensions/archive/archive_extension.rb +19 -0
  74. data/{lib → vendor/extensions/archive/lib}/archive_index_tags_and_methods.rb +0 -0
  75. data/vendor/extensions/archive/lib/tasks/archive_extension_tasks.rake +28 -0
  76. data/vendor/extensions/archive/test/fixtures/pages.yml +397 -0
  77. data/vendor/extensions/archive/test/functional/archive_extension_test.rb +16 -0
  78. data/{test → vendor/extensions/archive/test}/helpers/archive_index_test_helper.rb +0 -0
  79. data/vendor/extensions/archive/test/test_helper.rb +19 -0
  80. data/{test → vendor/extensions/archive/test}/unit/archive_day_index_page_test.rb +0 -0
  81. data/{test → vendor/extensions/archive/test}/unit/archive_month_index_page_test.rb +0 -0
  82. data/{test → vendor/extensions/archive/test}/unit/archive_page_test.rb +7 -1
  83. data/{test → vendor/extensions/archive/test}/unit/archive_year_index_page_test.rb +0 -0
  84. data/vendor/rails/actionmailer/CHANGELOG +10 -0
  85. data/vendor/rails/actionmailer/Rakefile +1 -1
  86. data/vendor/rails/actionmailer/lib/action_mailer/version.rb +1 -1
  87. data/vendor/rails/actionpack/CHANGELOG +51 -2
  88. data/vendor/rails/actionpack/Rakefile +1 -1
  89. data/vendor/rails/actionpack/lib/action_controller/assertions/dom_assertions.rb +2 -2
  90. data/vendor/rails/actionpack/lib/action_controller/assertions/model_assertions.rb +1 -1
  91. data/vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb +3 -0
  92. data/vendor/rails/actionpack/lib/action_controller/assertions/routing_assertions.rb +1 -0
  93. data/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb +2 -0
  94. data/vendor/rails/actionpack/lib/action_controller/base.rb +7 -1
  95. data/vendor/rails/actionpack/lib/action_controller/caching.rb +39 -38
  96. data/vendor/rails/actionpack/lib/action_controller/cgi_ext/pstore_performance_fix.rb +30 -0
  97. data/vendor/rails/actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb +1 -1
  98. data/vendor/rails/actionpack/lib/action_controller/cgi_process.rb +13 -4
  99. data/vendor/rails/actionpack/lib/action_controller/cookies.rb +5 -3
  100. data/vendor/rails/actionpack/lib/action_controller/filters.rb +176 -77
  101. data/vendor/rails/actionpack/lib/action_controller/integration.rb +31 -21
  102. data/vendor/rails/actionpack/lib/action_controller/macros/in_place_editing.rb +1 -1
  103. data/vendor/rails/actionpack/lib/action_controller/pagination.rb +7 -1
  104. data/vendor/rails/actionpack/lib/action_controller/resources.rb +117 -32
  105. data/vendor/rails/actionpack/lib/action_controller/routing.rb +56 -23
  106. data/vendor/rails/actionpack/lib/action_controller/test_process.rb +5 -2
  107. data/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb +4 -1
  108. data/vendor/rails/actionpack/lib/action_controller/verification.rb +1 -0
  109. data/vendor/rails/actionpack/lib/action_pack/version.rb +1 -1
  110. data/vendor/rails/actionpack/lib/action_view/base.rb +25 -19
  111. data/vendor/rails/actionpack/lib/action_view/compiled_templates.rb +2 -2
  112. data/vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb +18 -18
  113. data/vendor/rails/actionpack/lib/action_view/helpers/debug_helper.rb +10 -0
  114. data/vendor/rails/actionpack/lib/action_view/helpers/deprecated_helper.rb +3 -0
  115. data/vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb +33 -17
  116. data/vendor/rails/actionpack/test/activerecord/pagination_test.rb +9 -0
  117. data/vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb +13 -0
  118. data/vendor/rails/actionpack/test/controller/addresses_render_test.rb +4 -1
  119. data/vendor/rails/actionpack/test/controller/base_test.rb +1 -1
  120. data/vendor/rails/actionpack/test/controller/caching_test.rb +3 -2
  121. data/vendor/rails/actionpack/test/controller/cookie_test.rb +11 -0
  122. data/vendor/rails/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb +18 -0
  123. data/vendor/rails/actionpack/test/controller/filter_params_test.rb +1 -0
  124. data/vendor/rails/actionpack/test/controller/filters_test.rb +149 -26
  125. data/vendor/rails/actionpack/test/controller/integration_test.rb +93 -8
  126. data/vendor/rails/actionpack/test/controller/resources_test.rb +215 -36
  127. data/vendor/rails/actionpack/test/controller/routing_test.rb +2 -2
  128. data/vendor/rails/actionpack/test/controller/test_test.rb +16 -0
  129. data/vendor/rails/actionpack/test/controller/url_rewriter_test.rb +66 -10
  130. data/vendor/rails/actionpack/test/controller/verification_test.rb +15 -0
  131. data/vendor/rails/actionpack/test/fixtures/test/hello_world.rxml +2 -1
  132. data/vendor/rails/actionpack/test/template/asset_tag_helper_test.rb +5 -0
  133. data/vendor/rails/actionpack/test/template/compiled_templates_test.rb +29 -17
  134. data/vendor/rails/actionpack/test/template/javascript_helper_test.rb +4 -4
  135. data/vendor/rails/actionpack/test/template/number_helper_test.rb +1 -1
  136. data/vendor/rails/actionpack/test/template/prototype_helper_test.rb +13 -13
  137. data/vendor/rails/actionwebservice/CHANGELOG +14 -0
  138. data/vendor/rails/actionwebservice/Rakefile +2 -2
  139. data/vendor/rails/actionwebservice/lib/action_web_service/version.rb +1 -1
  140. data/vendor/rails/activerecord/CHANGELOG +34 -0
  141. data/vendor/rails/activerecord/Rakefile +1 -1
  142. data/vendor/rails/activerecord/lib/active_record/acts/list.rb +14 -2
  143. data/vendor/rails/activerecord/lib/active_record/acts/tree.rb +7 -0
  144. data/vendor/rails/activerecord/lib/active_record/associations.rb +29 -14
  145. data/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb +5 -1
  146. data/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb +2 -2
  147. data/vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb +10 -0
  148. data/vendor/rails/activerecord/lib/active_record/base.rb +12 -3
  149. data/vendor/rails/activerecord/lib/active_record/calculations.rb +2 -2
  150. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +1 -1
  151. data/vendor/rails/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb +1 -0
  152. data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +2 -2
  153. data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb +54 -38
  154. data/vendor/rails/activerecord/lib/active_record/deprecated_finders.rb +3 -3
  155. data/vendor/rails/activerecord/lib/active_record/fixtures.rb +1 -1
  156. data/vendor/rails/activerecord/lib/active_record/timestamp.rb +0 -9
  157. data/vendor/rails/activerecord/lib/active_record/version.rb +1 -1
  158. data/vendor/rails/activerecord/test/associations/eager_test.rb +13 -0
  159. data/vendor/rails/activerecord/test/associations/join_model_test.rb +10 -1
  160. data/vendor/rails/activerecord/test/associations_test.rb +36 -3
  161. data/vendor/rails/activerecord/test/base_test.rb +17 -4
  162. data/vendor/rails/activerecord/test/defaults_test.rb +15 -0
  163. data/vendor/rails/activerecord/test/fixtures/author.rb +1 -0
  164. data/vendor/rails/activerecord/test/fixtures/binaries.yml +437 -0
  165. data/vendor/rails/activerecord/test/fixtures/db_definitions/schema.rb +13 -0
  166. data/vendor/rails/activerecord/test/fixtures/developer.rb +10 -0
  167. data/vendor/rails/activerecord/test/fixtures_test.rb +9 -5
  168. data/vendor/rails/activerecord/test/migration_test.rb +9 -10
  169. data/vendor/rails/activerecord/test/mixin_test.rb +47 -0
  170. data/vendor/rails/activerecord/test/validations_test.rb +2 -2
  171. data/vendor/rails/activesupport/CHANGELOG +16 -0
  172. data/vendor/rails/activesupport/lib/active_support/core_ext/blank.rb +9 -3
  173. data/vendor/rails/activesupport/lib/active_support/core_ext/hash/conversions.rb +48 -3
  174. data/vendor/rails/activesupport/lib/active_support/core_ext/module/introspection.rb +14 -0
  175. data/vendor/rails/activesupport/lib/active_support/dependencies.rb +3 -3
  176. data/vendor/rails/activesupport/lib/active_support/json/encoders/core.rb +5 -3
  177. data/vendor/rails/activesupport/lib/active_support/multibyte/chars.rb +6 -6
  178. data/vendor/rails/activesupport/lib/active_support/version.rb +1 -1
  179. data/vendor/rails/activesupport/test/core_ext/hash_ext_test.rb +37 -0
  180. data/vendor/rails/activesupport/test/core_ext/module_test.rb +8 -0
  181. data/vendor/rails/activesupport/test/dependencies_test.rb +11 -0
  182. data/vendor/rails/activesupport/test/{json.rb → json_test.rb} +15 -5
  183. data/vendor/rails/railties/CHANGELOG +25 -1
  184. data/vendor/rails/railties/README +32 -3
  185. data/vendor/rails/railties/Rakefile +5 -5
  186. data/vendor/rails/railties/environments/boot.rb +12 -18
  187. data/vendor/rails/railties/environments/environment.rb +15 -15
  188. data/vendor/rails/railties/lib/dispatcher.rb +1 -2
  189. data/vendor/rails/railties/lib/initializer.rb +33 -9
  190. data/vendor/rails/railties/lib/rails/version.rb +1 -1
  191. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +1 -1
  192. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/scaffold_resource_generator.rb +1 -0
  193. data/vendor/rails/railties/lib/railties_path.rb +1 -1
  194. data/vendor/rails/railties/lib/tasks/framework.rake +4 -4
  195. data/vendor/rails/railties/lib/tasks/routes.rake +17 -0
  196. data/vendor/rails/release.rb +2 -2
  197. metadata +1877 -1848
@@ -265,7 +265,7 @@ class LegacyRouteSetTests < Test::Unit::TestCase
265
265
  map.content '/content/:query', :controller => 'content', :action => 'show'
266
266
  end
267
267
  exception = assert_raise(ActionController::RoutingError) { rs.generate(:controller => 'content', :action => 'show', :use_route => "content") }
268
- expected_message = %[content_url failed to generate from {:action=>"show", :controller=>"content"} - you may have ambiguous routes, or you may need to supply additional parameters for this route. content_url has the following required parameters: ["content", :query] - are they all satisifed?]
268
+ expected_message = "content_url failed to generate from #{{:action=>"show", :controller=>"content"}.inspect} - you may have ambiguous routes, or you may need to supply additional parameters for this route. content_url has the following required parameters: [\"content\", :query] - are they all satisifed?"
269
269
  assert_equal expected_message, exception.message
270
270
  end
271
271
 
@@ -946,7 +946,7 @@ class RouteTest < Test::Unit::TestCase
946
946
  end
947
947
 
948
948
  def test_expand_array_build_query_string
949
- assert_equal '?x[]=1&x[]=2', order_query_string(@route.build_query_string(:x => [1, 2]))
949
+ assert_equal '?x%5B%5D=1&x%5B%5D=2', order_query_string(@route.build_query_string(:x => [1, 2]))
950
950
  end
951
951
 
952
952
  def test_escape_spaces_build_query_string_selected_keys
@@ -482,6 +482,22 @@ HTML
482
482
  end
483
483
  end
484
484
 
485
+ def test_request_uri_updates
486
+ get :test_params
487
+ uri = @request.request_uri
488
+ assert_equal @request.env['REQUEST_URI'], uri
489
+
490
+ get :test_uri
491
+ assert_not_equal uri, @request.request_uri
492
+ uri = @request.request_uri
493
+ assert_equal @request.env['REQUEST_URI'], uri
494
+
495
+ get :test_uri, :testing => true
496
+ assert_not_equal uri, @request.request_uri
497
+ uri = @request.request_uri
498
+ assert_equal @request.env['REQUEST_URI'], uri
499
+ end
500
+
485
501
  protected
486
502
  def with_foo_routing
487
503
  with_routing do |set|
@@ -17,15 +17,12 @@ class UrlRewriterTests < Test::Unit::TestCase
17
17
  assert_match %r(/hi/hi/2$), u
18
18
  end
19
19
 
20
-
21
- private
22
- def split_query_string(str)
23
- [str[0].chr] + str[1..-1].split(/&/).sort
24
- end
25
-
26
- def assert_query_equal(q1, q2)
27
- assert_equal(split_query_string(q1), split_query_string(q2))
28
- end
20
+ def test_anchor
21
+ assert_equal(
22
+ 'http://test.host/c/a/i#anchor',
23
+ @rewriter.rewrite(:controller => 'c', :action => 'a', :id => 'i', :anchor => 'anchor')
24
+ )
25
+ end
29
26
  end
30
27
 
31
28
  class UrlWriterTests < Test::Unit::TestCase
@@ -75,6 +72,12 @@ class UrlWriterTests < Test::Unit::TestCase
75
72
  W.new.url_for(:controller => 'c', :action => 'a', :id => 'i', :protocol => 'https')
76
73
  )
77
74
  end
75
+
76
+ def test_anchor
77
+ assert_equal('/c/a#anchor',
78
+ W.new.url_for(:only_path => true, :controller => 'c', :action => 'a', :anchor => 'anchor')
79
+ )
80
+ end
78
81
 
79
82
  def test_named_route
80
83
  ActionController::Routing::Routes.draw do |map|
@@ -111,5 +114,58 @@ class UrlWriterTests < Test::Unit::TestCase
111
114
  ensure
112
115
  ActionController::Routing::Routes.load!
113
116
  end
114
-
117
+
118
+ def test_one_parameter
119
+ assert_equal('/c/a?param=val',
120
+ W.new.url_for(:only_path => true, :controller => 'c', :action => 'a', :param => 'val')
121
+ )
122
+ end
123
+
124
+ def test_two_parameters
125
+ url = W.new.url_for(:only_path => true, :controller => 'c', :action => 'a', :p1 => 'X1', :p2 => 'Y2')
126
+ params = extract_params(url)
127
+ assert_equal params[0], { :p1 => 'X1' }.to_query
128
+ assert_equal params[1], { :p2 => 'Y2' }.to_query
129
+ end
130
+
131
+ def test_hash_parameter
132
+ url = W.new.url_for(:only_path => true, :controller => 'c', :action => 'a', :query => {:name => 'Bob', :category => 'prof'})
133
+ params = extract_params(url)
134
+ assert_equal params[0], { 'query[category]' => 'prof' }.to_query
135
+ assert_equal params[1], { 'query[name]' => 'Bob' }.to_query
136
+ end
137
+
138
+ def test_array_parameter
139
+ url = W.new.url_for(:only_path => true, :controller => 'c', :action => 'a', :query => ['Bob', 'prof'])
140
+ params = extract_params(url)
141
+ assert_equal params[0], { 'query[]' => 'Bob' }.to_query
142
+ assert_equal params[1], { 'query[]' => 'prof' }.to_query
143
+ end
144
+
145
+ def test_hash_recursive_parameters
146
+ url = W.new.url_for(:only_path => true, :controller => 'c', :action => 'a', :query => {:person => {:name => 'Bob', :position => 'prof'}, :hobby => 'piercing'})
147
+ params = extract_params(url)
148
+ assert_equal params[0], { 'query[hobby]' => 'piercing' }.to_query
149
+ assert_equal params[1], { 'query[person][name]' => 'Bob' }.to_query
150
+ assert_equal params[2], { 'query[person][position]' => 'prof' }.to_query
151
+ end
152
+
153
+ def test_hash_recursive_and_array_parameters
154
+ url = W.new.url_for(:only_path => true, :controller => 'c', :action => 'a', :id => 101, :query => {:person => {:name => 'Bob', :position => ['prof', 'art director']}, :hobby => 'piercing'})
155
+ assert_match %r(^/c/a/101), url
156
+ params = extract_params(url)
157
+ assert_equal params[0], { 'query[hobby]' => 'piercing' }.to_query
158
+ assert_equal params[1], { 'query[person][name]' => 'Bob' }.to_query
159
+ assert_equal params[2], { 'query[person][position][]' => 'art director' }.to_query
160
+ assert_equal params[3], { 'query[person][position][]' => 'prof' }.to_query
161
+ end
162
+
163
+ def test_path_generation_for_symbol_parameter_keys
164
+ assert_generates("/image", :controller=> :image)
165
+ end
166
+
167
+ private
168
+ def extract_params(url)
169
+ url.split('?', 2).last.split('&')
170
+ end
115
171
  end
@@ -34,9 +34,16 @@ class VerificationTest < Test::Unit::TestCase
34
34
 
35
35
  verify :only => :must_be_post, :method => :post, :render => { :status => 405, :text => "Must be post" }, :add_headers => { "Allow" => "POST" }
36
36
 
37
+ verify :only => :guarded_one_for_named_route_test, :params => "one",
38
+ :redirect_to => :foo_url
39
+
37
40
  def guarded_one
38
41
  render :text => "#{params[:one]}"
39
42
  end
43
+
44
+ def guarded_one_for_named_route_test
45
+ render :text => "#{params[:one]}"
46
+ end
40
47
 
41
48
  def guarded_with_flash
42
49
  render :text => "#{params[:one]}"
@@ -94,6 +101,14 @@ class VerificationTest < Test::Unit::TestCase
94
101
  @controller = TestController.new
95
102
  @request = ActionController::TestRequest.new
96
103
  @response = ActionController::TestResponse.new
104
+ ActionController::Routing::Routes.add_named_route :foo, '/foo', :controller => 'test', :action => 'foo'
105
+ end
106
+
107
+ def test_no_deprecation_warning_for_named_route
108
+ assert_not_deprecated do
109
+ get :guarded_one_for_named_route_test, :two => "not one"
110
+ assert_redirected_to '/foo'
111
+ end
97
112
  end
98
113
 
99
114
  def test_guarded_one_with_prereqs
@@ -1,3 +1,4 @@
1
1
  xml.html do
2
2
  xml.p "Hello"
3
- end
3
+ end
4
+ "String return value"
@@ -165,7 +165,12 @@ class AssetTagHelperTest < Test::Unit::TestCase
165
165
 
166
166
  def test_preset_empty_asset_id
167
167
  Object.send(:const_set, :RAILS_ROOT, File.dirname(__FILE__) + "/../fixtures/")
168
+ # on windows, setting ENV["XXX"] to "" makes ENV["XXX"] return nil
169
+ if RUBY_PLATFORM =~ /win32/
170
+ ENV["RAILS_ASSET_ID"] = " "
171
+ else
168
172
  ENV["RAILS_ASSET_ID"] = ""
173
+ end
169
174
  assert_equal %(<img alt="Rails" src="/images/rails.png" />), image_tag("rails.png")
170
175
  end
171
176
 
@@ -71,7 +71,12 @@ class CompiledTemplateTests < Test::Unit::TestCase
71
71
  end
72
72
 
73
73
  def test_compile_time
74
- `echo '#{@a}' > #{@a}; echo '#{@b}' > #{@b}; ln -s #{@a} #{@s}`
74
+ File.open(@a, "w"){|f| f.puts @a}
75
+ File.open(@b, "w"){|f| f.puts @b}
76
+
77
+ # windows doesn't support symlinks (even under cygwin)
78
+ windows = (RUBY_PLATFORM =~ /win32/)
79
+ `ln -s #{@a} #{@s}` unless windows
75
80
 
76
81
  v = ActionView::Base.new
77
82
  v.base_path = '.'
@@ -79,47 +84,54 @@ class CompiledTemplateTests < Test::Unit::TestCase
79
84
 
80
85
  sleep 1
81
86
  t = Time.now
87
+ sleep 1
88
+
82
89
  v.compile_and_render_template(:rhtml, '', @a)
83
90
  v.compile_and_render_template(:rhtml, '', @b)
84
- v.compile_and_render_template(:rhtml, '', @s)
91
+ v.compile_and_render_template(:rhtml, '', @s) unless windows
92
+
85
93
  a_n = v.method_names[@a]
86
94
  b_n = v.method_names[@b]
87
- s_n = v.method_names[@s]
95
+ s_n = v.method_names[@s] unless windows
96
+ ct_a = v.compile_time[a_n]
97
+ ct_b = v.compile_time[b_n]
98
+ ct_s = v.compile_time[s_n] unless windows
88
99
  # all of the files have changed since last compile
89
100
  assert v.compile_time[a_n] > t
90
101
  assert v.compile_time[b_n] > t
91
- assert v.compile_time[s_n] > t
102
+ assert v.compile_time[s_n] > t unless windows
92
103
 
93
104
  sleep 1
94
- t = Time.now
95
105
  v.compile_and_render_template(:rhtml, '', @a)
96
106
  v.compile_and_render_template(:rhtml, '', @b)
97
- v.compile_and_render_template(:rhtml, '', @s)
107
+ v.compile_and_render_template(:rhtml, '', @s) unless windows
98
108
  # none of the files have changed since last compile
99
- assert v.compile_time[a_n] < t
100
- assert v.compile_time[b_n] < t
101
- assert v.compile_time[s_n] < t
109
+ # so they should not have been recmpiled
110
+ assert_equal ct_a, v.compile_time[a_n]
111
+ assert_equal ct_b, v.compile_time[b_n]
112
+ assert_equal ct_s, v.compile_time[s_n] unless windows
102
113
 
103
- `rm #{@s}; ln -s #{@b} #{@s}`
114
+ `rm #{@s}; ln -s #{@b} #{@s}` unless windows
104
115
  v.compile_and_render_template(:rhtml, '', @a)
105
116
  v.compile_and_render_template(:rhtml, '', @b)
106
- v.compile_and_render_template(:rhtml, '', @s)
117
+ v.compile_and_render_template(:rhtml, '', @s) unless windows
107
118
  # the symlink has changed since last compile
108
- assert v.compile_time[a_n] < t
109
- assert v.compile_time[b_n] < t
110
- assert v.compile_time[s_n] > t
119
+ assert_equal ct_a, v.compile_time[a_n]
120
+ assert_equal ct_b, v.compile_time[b_n]
121
+ assert v.compile_time[s_n] > t unless windows
111
122
 
112
123
  sleep 1
113
- `touch #{@b}`
124
+ FileUtils.touch @b
114
125
  t = Time.now
126
+ sleep 1
115
127
  v.compile_and_render_template(:rhtml, '', @a)
116
128
  v.compile_and_render_template(:rhtml, '', @b)
117
- v.compile_and_render_template(:rhtml, '', @s)
129
+ v.compile_and_render_template(:rhtml, '', @s) unless windows
118
130
  # the file at the end of the symlink has changed since last compile
119
131
  # both the symlink and the file at the end of it should be recompiled
120
132
  assert v.compile_time[a_n] < t
121
133
  assert v.compile_time[b_n] > t
122
- assert v.compile_time[s_n] > t
134
+ assert v.compile_time[s_n] > t unless windows
123
135
  end
124
136
  end
125
137
 
@@ -36,14 +36,14 @@ class JavaScriptHelperTest < Test::Unit::TestCase
36
36
  html = link_to_function( "Greet me!" ) do |page|
37
37
  page.replace_html 'header', "<h1>Greetings</h1>"
38
38
  end
39
- assert_dom_equal %(<a href="#" onclick="Element.update(&quot;header&quot;, &quot;&lt;h1&gt;Greetings&lt;/h1&gt;&quot;);; return false;">Greet me!</a>), html
39
+ assert_dom_equal %q(<a href="#" onclick="Element.update(&quot;header&quot;, &quot;\074h1\076Greetings\074/h1\076&quot;);; return false;">Greet me!</a>), html
40
40
  end
41
41
 
42
42
  def test_link_to_function_with_rjs_block_and_options
43
43
  html = link_to_function( "Greet me!", :class => "updater" ) do |page|
44
44
  page.replace_html 'header', "<h1>Greetings</h1>"
45
45
  end
46
- assert_dom_equal %(<a href="#" class="updater" onclick="Element.update(&quot;header&quot;, &quot;&lt;h1&gt;Greetings&lt;/h1&gt;&quot;);; return false;">Greet me!</a>), html
46
+ assert_dom_equal %q(<a href="#" class="updater" onclick="Element.update(&quot;header&quot;, &quot;\074h1\076Greetings\074/h1\076&quot;);; return false;">Greet me!</a>), html
47
47
  end
48
48
 
49
49
  def test_button_to_function
@@ -55,13 +55,13 @@ class JavaScriptHelperTest < Test::Unit::TestCase
55
55
  html = button_to_function( "Greet me!" ) do |page|
56
56
  page.replace_html 'header', "<h1>Greetings</h1>"
57
57
  end
58
- assert_dom_equal %(<input type="button" onclick="Element.update(&quot;header&quot;, &quot;&lt;h1&gt;Greetings&lt;/h1&gt;&quot;);;" value="Greet me!" />), html
58
+ assert_dom_equal %q(<input type="button" onclick="Element.update(&quot;header&quot;, &quot;\074h1\076Greetings\074/h1\076&quot;);;" value="Greet me!" />), html
59
59
  end
60
60
 
61
61
  def test_button_to_function_with_rjs_block_and_options
62
62
  html = button_to_function( "Greet me!", :class => "greeter" ) do |page|
63
63
  page.replace_html 'header', "<h1>Greetings</h1>"
64
64
  end
65
- assert_dom_equal %(<input type="button" class="greeter" onclick="Element.update(&quot;header&quot;, &quot;&lt;h1&gt;Greetings&lt;/h1&gt;&quot;);;" value="Greet me!" />), html
65
+ assert_dom_equal %q(<input type="button" class="greeter" onclick="Element.update(&quot;header&quot;, &quot;\074h1\076Greetings\074/h1\076&quot;);;" value="Greet me!" />), html
66
66
  end
67
67
  end
@@ -22,7 +22,7 @@ class NumberHelperTest < Test::Unit::TestCase
22
22
  def test_number_to_currency
23
23
  assert_equal("$1,234,567,890.50", number_to_currency(1234567890.50))
24
24
  assert_equal("$1,234,567,890.51", number_to_currency(1234567890.506))
25
- assert_equal("$1,234,567,890", number_to_currency(1234567890.50, {:precision => 0}))
25
+ assert_equal("$1,234,567,891", number_to_currency(1234567890.51, {:precision => 0}))
26
26
  assert_equal("$1,234,567,890.5", number_to_currency(1234567890.50, {:precision => 1}))
27
27
  assert_equal("&pound;1234567890,50", number_to_currency(1234567890.50, {:unit => "&pound;", :separator => ",", :delimiter => ""}))
28
28
  assert_equal("$1,234,567,890.50", number_to_currency("1234567890.50"))
@@ -125,7 +125,7 @@ class PrototypeHelperTest < Test::Unit::TestCase
125
125
  end
126
126
 
127
127
  def test_observe_field
128
- assert_dom_equal %(<script type=\"text/javascript\">\n//<![CDATA[\nnew Form.Element.Observer('glass', 300, function(element, value) {new Ajax.Request('http://www.example.com/reorder_if_empty', {asynchronous:true, evalScripts:true})})\n//]]>\n</script>),
128
+ assert_dom_equal %(<script type=\"text/javascript\">\n//<![CDATA[\nnew Form.Element.Observer('glass', 300, function(element, value) {new Ajax.Request('http://www.example.com/reorder_if_empty', {asynchronous:true, evalScripts:true, parameters:value})})\n//]]>\n</script>),
129
129
  observe_field("glass", :frequency => 5.minutes, :url => { :action => "reorder_if_empty" })
130
130
  end
131
131
 
@@ -135,7 +135,7 @@ class PrototypeHelperTest < Test::Unit::TestCase
135
135
  end
136
136
 
137
137
  def test_observe_form
138
- assert_dom_equal %(<script type=\"text/javascript\">\n//<![CDATA[\nnew Form.Observer('cart', 2, function(element, value) {new Ajax.Request('http://www.example.com/cart_changed', {asynchronous:true, evalScripts:true})})\n//]]>\n</script>),
138
+ assert_dom_equal %(<script type=\"text/javascript\">\n//<![CDATA[\nnew Form.Observer('cart', 2, function(element, value) {new Ajax.Request('http://www.example.com/cart_changed', {asynchronous:true, evalScripts:true, parameters:value})})\n//]]>\n</script>),
139
139
  observe_form("cart", :frequency => 2, :url => { :action => "cart_changed" })
140
140
  end
141
141
 
@@ -170,23 +170,23 @@ class JavaScriptGeneratorTest < Test::Unit::TestCase
170
170
  end
171
171
 
172
172
  def test_insert_html_with_string
173
- assert_equal 'new Insertion.Top("element", "<p>This is a test</p>");',
173
+ assert_equal 'new Insertion.Top("element", "\074p\076This is a test\074/p\076");',
174
174
  @generator.insert_html(:top, 'element', '<p>This is a test</p>')
175
- assert_equal 'new Insertion.Bottom("element", "<p>This is a test</p>");',
175
+ assert_equal 'new Insertion.Bottom("element", "\074p\076This is a test\074/p\076");',
176
176
  @generator.insert_html(:bottom, 'element', '<p>This is a test</p>')
177
- assert_equal 'new Insertion.Before("element", "<p>This is a test</p>");',
177
+ assert_equal 'new Insertion.Before("element", "\074p\076This is a test\074/p\076");',
178
178
  @generator.insert_html(:before, 'element', '<p>This is a test</p>')
179
- assert_equal 'new Insertion.After("element", "<p>This is a test</p>");',
179
+ assert_equal 'new Insertion.After("element", "\074p\076This is a test\074/p\076");',
180
180
  @generator.insert_html(:after, 'element', '<p>This is a test</p>')
181
181
  end
182
182
 
183
183
  def test_replace_html_with_string
184
- assert_equal 'Element.update("element", "<p>This is a test</p>");',
184
+ assert_equal 'Element.update("element", "\074p\076This is a test\074/p\076");',
185
185
  @generator.replace_html('element', '<p>This is a test</p>')
186
186
  end
187
187
 
188
188
  def test_replace_element_with_string
189
- assert_equal 'Element.replace("element", "<div id=\"element\"><p>This is a test</p></div>");',
189
+ assert_equal 'Element.replace("element", "\074div id=\"element\"\076\074p\076This is a test\074/p\076\074/div\076");',
190
190
  @generator.replace('element', '<div id="element"><p>This is a test</p></div>')
191
191
  end
192
192
 
@@ -241,12 +241,12 @@ class JavaScriptGeneratorTest < Test::Unit::TestCase
241
241
  @generator.remove('foo', 'bar')
242
242
  @generator.replace_html('baz', '<p>This is a test</p>')
243
243
 
244
- assert_equal <<-EOS.chomp, @generator.to_s
245
- new Insertion.Top("element", "<p>This is a test</p>");
246
- new Insertion.Bottom("element", "<p>This is a test</p>");
244
+ expected = %q(new Insertion.Top("element", "\074p\076This is a test\074/p\076");
245
+ new Insertion.Bottom("element", "\074p\076This is a test\074/p\076");
247
246
  ["foo", "bar"].each(Element.remove);
248
- Element.update("baz", "<p>This is a test</p>");
249
- EOS
247
+ Element.update("baz", "\074p\076This is a test\074/p\076");)
248
+
249
+ assert_equal expected, @generator.to_s
250
250
  end
251
251
 
252
252
  def test_element_access
@@ -1,3 +1,17 @@
1
+ *1.2.5* (October 12th, 2007)
2
+
3
+ * Depend on Action Pack 1.13.5
4
+
5
+ * Depend on Active Record 1.15.5
6
+
7
+
8
+ *1.2.4* (October 4th, 2007)
9
+
10
+ * Depend on Action Pack 1.13.4
11
+
12
+ * Depend on Active Record 1.15.4
13
+
14
+
1
15
  *1.2.3* (March 12th, 2007)
2
16
 
3
17
  * Depend on Action Pack 1.13.3
@@ -71,8 +71,8 @@ spec = Gem::Specification.new do |s|
71
71
  s.rubyforge_project = "aws"
72
72
  s.homepage = "http://www.rubyonrails.org"
73
73
 
74
- s.add_dependency('actionpack', '= 1.13.3' + PKG_BUILD)
75
- s.add_dependency('activerecord', '= 1.15.3' + PKG_BUILD)
74
+ s.add_dependency('actionpack', '= 1.13.5' + PKG_BUILD)
75
+ s.add_dependency('activerecord', '= 1.15.5' + PKG_BUILD)
76
76
 
77
77
  s.has_rdoc = true
78
78
  s.requirements << 'none'
@@ -2,7 +2,7 @@ module ActionWebService
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 1
4
4
  MINOR = 2
5
- TINY = 3
5
+ TINY = 5
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -1,3 +1,37 @@
1
+ *1.15.5* (October 12th, 2007)
2
+
3
+ * Depend on Action Pack 1.4.4
4
+
5
+
6
+ *1.15.4* (October 4th, 2007)
7
+
8
+ * Fix #count on a has_many :through association so that it recognizes the :uniq option. Closes #8801 [lifofifo]
9
+
10
+ * Don't clobber includes passed to has_many.count [danger]
11
+
12
+ * Make sure has_many uses :include when counting [danger]
13
+
14
+ * Save associated records only if the association is already loaded. #8713 [blaine]
15
+
16
+ * Changing the :default Date format doesn't break date quoting. #6312 [bshand, Elias]
17
+
18
+ * Allow nil serialized attributes with a set class constraint. #7293 [sandofsky]
19
+
20
+ * belongs_to assignment creates a new proxy rather than modifying its target in-place. #8412 [mmangino@elevatedrails.com]
21
+
22
+ * Fix column type detection while loading fixtures. Closes #7987 [roderickvd]
23
+
24
+ * Document deep eager includes. #6267 [Josh Susser, Dan Manges]
25
+
26
+ * Oracle: extract column length for CHAR also. #7866 [ymendel]
27
+
28
+ * Small additions and fixes for ActiveRecord documentation. Closes #7342 [jeremymcanally]
29
+
30
+ * SQLite: binary escaping works with $KCODE='u'. #7862 [tsuka]
31
+
32
+ * Improved cloning performance by relying less on exception raising #8159 [Blaine]
33
+
34
+
1
35
  *1.15.3* (March 12th, 2007)
2
36
 
3
37
  * Allow a polymorphic :source for has_many :through associations. Closes #7143 [protocool]