Permalink
Browse files

Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki

  • Loading branch information...
2 parents 8935ed6 + 70f3e00 commit 17451c71218353915bac5db59cc8d3d583dfef06 @distler distler committed Feb 12, 2013
Showing with 100 additions and 73 deletions.
  1. +3 −2 test/unit/page_renderer_test.rb
  2. +1 −1 vendor/rails/actionmailer/Rakefile
  3. +2 −2 vendor/rails/actionmailer/actionmailer.gemspec
  4. +1 −1 vendor/rails/actionmailer/lib/action_mailer/version.rb
  5. +1 −1 vendor/rails/actionpack/Rakefile
  6. +2 −2 vendor/rails/actionpack/actionpack.gemspec
  7. +1 −1 vendor/rails/actionpack/lib/action_pack/version.rb
  8. +19 −19 vendor/rails/actionpack/test/template/active_record_helper_test.rb
  9. +3 −3 vendor/rails/actionpack/test/template/erb_util_test.rb
  10. +10 −10 vendor/rails/actionpack/test/template/form_helper_test.rb
  11. +5 −1 vendor/rails/actionpack/test/template/text_helper_test.rb
  12. +1 −1 vendor/rails/activerecord/Rakefile
  13. +2 −2 vendor/rails/activerecord/activerecord.gemspec
  14. +17 −2 vendor/rails/activerecord/lib/active_record/attribute_methods.rb
  15. +3 −3 vendor/rails/activerecord/lib/active_record/base.rb
  16. +1 −1 vendor/rails/activerecord/lib/active_record/version.rb
  17. +6 −0 vendor/rails/activerecord/test/cases/base_test.rb
  18. +1 −1 vendor/rails/activeresource/Rakefile
  19. +2 −2 vendor/rails/activeresource/activeresource.gemspec
  20. +1 −1 vendor/rails/activeresource/lib/active_resource/version.rb
  21. +1 −1 vendor/rails/activesupport/activesupport.gemspec
  22. +1 −1 vendor/rails/activesupport/lib/active_support/core_ext/string/output_safety.rb
  23. +1 −1 vendor/rails/activesupport/lib/active_support/version.rb
  24. +5 −5 vendor/rails/railties/Rakefile
  25. +3 −2 vendor/rails/railties/guides/source/active_record_querying.textile
  26. +1 −1 vendor/rails/railties/lib/rails/version.rb
  27. +6 −6 vendor/rails/railties/railties.gemspec
@@ -239,8 +239,9 @@ def test_footnotes
def test_toc
assert_markup_parsed_as(
- %{<h1 id='title_1'>Title</h1>\n<div class='maruku_toc'><ul><li><a href='#section_1_2'>Sect} +
- %{ion 1</a></li><li><a href='#section_2_3'>Section 2</a></li></ul></div>\n<h2 id='section_} +
+ %{<h1 id='title_1'>Title</h1>\n<div class='maruku_toc'><ul><li><a href='#title_1'>Title<} +
+ %{/a><ul><li><a href='#section_1_2'>Section 1</a></l} +
+ %{i><li><a href='#section_2_3'>Section 2</a></li></ul></li></ul></div>\n<h2 id='section_} +
%{1_2'>Section 1</h2>\n\n<p>Foo</p>\n\n<h2 id='section_2_3'>Section 2</h2>\n\n<p>Bar</p>},
"#Title\n* Toc\n{:toc}\n\n##Section 1\n\nFoo\n\n##Section 2\n\nBar\n")
end
@@ -54,7 +54,7 @@ spec = Gem::Specification.new do |s|
s.rubyforge_project = "actionmailer"
s.homepage = "http://www.rubyonrails.org"
- s.add_dependency('actionpack', '= 2.3.16' + PKG_BUILD)
+ s.add_dependency('actionpack', '= 2.3.17' + PKG_BUILD)
s.requirements << 'none'
s.require_path = 'lib'
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'actionmailer'
- s.version = '2.3.15'
+ s.version = '2.3.17'
s.summary = 'Service layer for easy email delivery and testing.'
s.description = 'Makes it trivial to test and deliver emails sent from a single service layer.'
@@ -10,5 +10,5 @@ Gem::Specification.new do |s|
s.require_path = 'lib'
- s.add_dependency 'actionpack', '= 2.3.15'
+ s.add_dependency 'actionpack', '= 2.3.17'
end
@@ -2,7 +2,7 @@ module ActionMailer
module VERSION #:nodoc:
MAJOR = 2
MINOR = 3
- TINY = 16
+ TINY = 17
STRING = [MAJOR, MINOR, TINY].join('.')
end
@@ -78,7 +78,7 @@ spec = Gem::Specification.new do |s|
s.requirements << 'none'
- s.add_dependency('activesupport', '= 2.3.16' + PKG_BUILD)
+ s.add_dependency('activesupport', '= 2.3.17' + PKG_BUILD)
s.add_dependency('rack', '~> 1.1.0')
s.require_path = 'lib'
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'actionpack'
- s.version = '2.3.15'
+ s.version = '2.3.17'
s.summary = 'Web-flow and rendering framework putting the VC in MVC.'
s.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.'
@@ -10,6 +10,6 @@ Gem::Specification.new do |s|
s.require_path = 'lib'
- s.add_dependency 'activesupport', '= 2.3.15'
+ s.add_dependency 'activesupport', '= 2.3.17'
s.add_dependency 'rack', '~> 1.1.0'
end
@@ -2,7 +2,7 @@ module ActionPack #:nodoc:
module VERSION #:nodoc:
MAJOR = 2
MINOR = 3
- TINY = 16
+ TINY = 17
STRING = [MAJOR, MINOR, TINY].join('.')
end
@@ -213,15 +213,15 @@ def Post.content_columns() [ Column.new(:datetime, "written_on", "Written on") ]
end
def test_error_for_block
- assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can't be empty</li></ul></div>), error_messages_for("post")
- assert_equal %(<div class="errorDeathByClass" id="errorDeathById"><h1>1 error prohibited this post from being saved</h1><p>There were problems with the following fields:</p><ul><li>Author name can't be empty</li></ul></div>), error_messages_for("post", :class => "errorDeathByClass", :id => "errorDeathById", :header_tag => "h1")
- assert_equal %(<div id="errorDeathById"><h1>1 error prohibited this post from being saved</h1><p>There were problems with the following fields:</p><ul><li>Author name can't be empty</li></ul></div>), error_messages_for("post", :class => nil, :id => "errorDeathById", :header_tag => "h1")
- assert_equal %(<div class="errorDeathByClass"><h1>1 error prohibited this post from being saved</h1><p>There were problems with the following fields:</p><ul><li>Author name can't be empty</li></ul></div>), error_messages_for("post", :class => "errorDeathByClass", :id => nil, :header_tag => "h1")
+ assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can&#39;t be empty</li></ul></div>), error_messages_for("post")
+ assert_equal %(<div class="errorDeathByClass" id="errorDeathById"><h1>1 error prohibited this post from being saved</h1><p>There were problems with the following fields:</p><ul><li>Author name can&#39;t be empty</li></ul></div>), error_messages_for("post", :class => "errorDeathByClass", :id => "errorDeathById", :header_tag => "h1")
+ assert_equal %(<div id="errorDeathById"><h1>1 error prohibited this post from being saved</h1><p>There were problems with the following fields:</p><ul><li>Author name can&#39;t be empty</li></ul></div>), error_messages_for("post", :class => nil, :id => "errorDeathById", :header_tag => "h1")
+ assert_equal %(<div class="errorDeathByClass"><h1>1 error prohibited this post from being saved</h1><p>There were problems with the following fields:</p><ul><li>Author name can&#39;t be empty</li></ul></div>), error_messages_for("post", :class => "errorDeathByClass", :id => nil, :header_tag => "h1")
end
def test_error_messages_for_escapes_html
@dirty_post = DirtyPost.new
- assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited this dirty post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can't be &lt;em&gt;empty&lt;/em&gt;</li></ul></div>), error_messages_for("dirty_post")
+ assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited this dirty post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can&#39;t be &lt;em&gt;empty&lt;/em&gt;</li></ul></div>), error_messages_for("dirty_post")
end
def test_error_messages_for_handles_nil
@@ -230,51 +230,51 @@ def test_error_messages_for_handles_nil
def test_error_message_on_escapes_html
@dirty_post = DirtyPost.new
- assert_dom_equal "<div class=\"formError\">can't be &lt;em&gt;empty&lt;/em&gt;</div>", error_message_on(:dirty_post, :author_name)
+ assert_dom_equal "<div class=\"formError\">can&#39;t be &lt;em&gt;empty&lt;/em&gt;</div>", error_message_on(:dirty_post, :author_name)
end
def test_error_message_on_handles_nil
assert_equal "", error_message_on("notthere", "notthere")
end
def test_error_message_on
- assert_dom_equal "<div class=\"formError\">can't be empty</div>", error_message_on(:post, :author_name)
+ assert_dom_equal "<div class=\"formError\">can&#39;t be empty</div>", error_message_on(:post, :author_name)
end
def test_error_message_on_no_instance_variable
other_post = @post
- assert_dom_equal "<div class=\"formError\">can't be empty</div>", error_message_on(other_post, :author_name)
+ assert_dom_equal "<div class=\"formError\">can&#39;t be empty</div>", error_message_on(other_post, :author_name)
end
def test_error_message_on_with_options_hash
- assert_dom_equal "<div class=\"differentError\">beforecan't be emptyafter</div>", error_message_on(:post, :author_name, :css_class => 'differentError', :prepend_text => 'before', :append_text => 'after')
+ assert_dom_equal "<div class=\"differentError\">beforecan&#39;t be emptyafter</div>", error_message_on(:post, :author_name, :css_class => 'differentError', :prepend_text => 'before', :append_text => 'after')
end
def test_error_messages_for_many_objects
- assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>2 errors prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can't be empty</li><li>User email can't be empty</li></ul></div>), error_messages_for("post", "user")
+ assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>2 errors prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can&#39;t be empty</li><li>User email can&#39;t be empty</li></ul></div>), error_messages_for("post", "user")
# reverse the order, error order changes and so does the title
- assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>2 errors prohibited this user from being saved</h2><p>There were problems with the following fields:</p><ul><li>User email can't be empty</li><li>Author name can't be empty</li></ul></div>), error_messages_for("user", "post")
+ assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>2 errors prohibited this user from being saved</h2><p>There were problems with the following fields:</p><ul><li>User email can&#39;t be empty</li><li>Author name can&#39;t be empty</li></ul></div>), error_messages_for("user", "post")
# add the default to put post back in the title
- assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>2 errors prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>User email can't be empty</li><li>Author name can't be empty</li></ul></div>), error_messages_for("user", "post", :object_name => "post")
+ assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>2 errors prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>User email can&#39;t be empty</li><li>Author name can&#39;t be empty</li></ul></div>), error_messages_for("user", "post", :object_name => "post")
# symbols work as well
- assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>2 errors prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>User email can't be empty</li><li>Author name can't be empty</li></ul></div>), error_messages_for(:user, :post, :object_name => :post)
+ assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>2 errors prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>User email can&#39;t be empty</li><li>Author name can&#39;t be empty</li></ul></div>), error_messages_for(:user, :post, :object_name => :post)
# any default works too
- assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>2 errors prohibited this monkey from being saved</h2><p>There were problems with the following fields:</p><ul><li>User email can't be empty</li><li>Author name can't be empty</li></ul></div>), error_messages_for(:user, :post, :object_name => "monkey")
+ assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>2 errors prohibited this monkey from being saved</h2><p>There were problems with the following fields:</p><ul><li>User email can&#39;t be empty</li><li>Author name can&#39;t be empty</li></ul></div>), error_messages_for(:user, :post, :object_name => "monkey")
# should space object name
- assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>2 errors prohibited this chunky bacon from being saved</h2><p>There were problems with the following fields:</p><ul><li>User email can't be empty</li><li>Author name can't be empty</li></ul></div>), error_messages_for(:user, :post, :object_name => "chunky_bacon")
+ assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>2 errors prohibited this chunky bacon from being saved</h2><p>There were problems with the following fields:</p><ul><li>User email can&#39;t be empty</li><li>Author name can&#39;t be empty</li></ul></div>), error_messages_for(:user, :post, :object_name => "chunky_bacon")
# hide header and explanation messages with nil or empty string
- assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><ul><li>User email can't be empty</li><li>Author name can't be empty</li></ul></div>), error_messages_for(:user, :post, :header_message => nil, :message => "")
+ assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><ul><li>User email can&#39;t be empty</li><li>Author name can&#39;t be empty</li></ul></div>), error_messages_for(:user, :post, :header_message => nil, :message => "")
# override header and explanation messages
header_message = "Yikes! Some errors"
message = "Please fix the following fields and resubmit:"
- assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>#{header_message}</h2><p>#{message}</p><ul><li>User email can't be empty</li><li>Author name can't be empty</li></ul></div>), error_messages_for(:user, :post, :header_message => header_message, :message => message)
+ assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>#{header_message}</h2><p>#{message}</p><ul><li>User email can&#39;t be empty</li><li>Author name can&#39;t be empty</li></ul></div>), error_messages_for(:user, :post, :header_message => header_message, :message => message)
end
def test_error_messages_for_non_instance_variable
@@ -284,10 +284,10 @@ def test_error_messages_for_non_instance_variable
@post = nil
#explicitly set object
- assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can't be empty</li></ul></div>), error_messages_for("post", :object => actual_post)
+ assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can&#39;t be empty</li></ul></div>), error_messages_for("post", :object => actual_post)
#multiple objects
- assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>2 errors prohibited this user from being saved</h2><p>There were problems with the following fields:</p><ul><li>User email can't be empty</li><li>Author name can't be empty</li></ul></div>), error_messages_for("user", "post", :object => [actual_user, actual_post])
+ assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>2 errors prohibited this user from being saved</h2><p>There were problems with the following fields:</p><ul><li>User email can&#39;t be empty</li><li>Author name can&#39;t be empty</li></ul></div>), error_messages_for("user", "post", :object => [actual_user, actual_post])
#nil object
assert_equal '', error_messages_for('user', :object => nil)
@@ -8,7 +8,7 @@ class ErbUtilTest < Test::Unit::TestCase
assert_equal expected, html_escape(given)
end
- unless given == '"'
+ unless given == '"' || given == "'"
define_method "test_json_escape_#{expected.gsub /\W/, ''}" do
assert_equal ERB::Util::JSON_ESCAPE[given], json_escape(given)
end
@@ -26,10 +26,10 @@ def test_html_escape_passes_html_escpe_unmodified
assert_equal "<p>", escaped
assert escaped.html_safe?
end
-
+
def test_rest_in_ascii
(0..127).to_a.map(&:chr).each do |chr|
- next if %w(& " < >).include?(chr)
+ next if %w(& " < > ').include?(chr)
assert_equal chr, html_escape(chr)
end
end
@@ -743,7 +743,7 @@ def test_nested_fields_for_with_an_existing_record_on_a_nested_attributes_one_to
assert_dom_equal expected, output_buffer
end
-
+
def test_nested_fields_for_with_existing_records_on_a_nested_attributes_one_to_one_association_with_explicit_hidden_field_placement
@post.author = Author.new(321)
@@ -754,7 +754,7 @@ def test_nested_fields_for_with_existing_records_on_a_nested_attributes_one_to_o
concat af.text_field(:name)
end
end
-
+
expected = '<form action="http://www.example.com" method="post">' +
'<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
'<input id="post_author_attributes_id" name="post[author_attributes][id]" type="hidden" value="321" />' +
@@ -799,7 +799,7 @@ def test_nested_fields_for_with_existing_records_on_a_nested_attributes_collecti
end
end
end
-
+
expected = '<form action="http://www.example.com" method="post">' +
'<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
'<input id="post_comments_attributes_0_id" name="post[comments_attributes][0][id]" type="hidden" value="1" />' +
@@ -1195,8 +1195,8 @@ def test_default_form_builder_with_active_record_helpers
end
expected = %(<form action='http://www.example.com' method='post'>) +
- %(<div class='formError'>can't be empty</div>) +
- %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can't be empty</li></ul></div>) +
+ %(<div class='formError'>can&#39;t be empty</div>) +
+ %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can&#39;t be empty</li></ul></div>) +
%(</form>)
assert_dom_equal expected, output_buffer
@@ -1213,14 +1213,14 @@ def test_default_form_builder_no_instance_variable
end
expected = %(<form action='http://www.example.com' method='post'>) +
- %(<div class='formError'>can't be empty</div>) +
- %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can't be empty</li></ul></div>) +
+ %(<div class='formError'>can&#39;t be empty</div>) +
+ %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can&#39;t be empty</li></ul></div>) +
%(</form>)
assert_dom_equal expected, output_buffer
end
-
+
def test_default_form_builder_without_object
form_for(:post) do |f|
@@ -1229,8 +1229,8 @@ def test_default_form_builder_without_object
end
expected = %(<form action='http://www.example.com' method='post'>) +
- %(<div class='formError'>can't be empty</div>) +
- %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can't be empty</li></ul></div>) +
+ %(<div class='formError'>can&#39;t be empty</div>) +
+ %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can&#39;t be empty</li></ul></div>) +
%(</form>)
assert_dom_equal expected, output_buffer
@@ -259,7 +259,6 @@ def test_auto_link_parsing
http://en.wikipedia.org/wiki/Wikipedia:Today%27s_featured_picture_%28animation%29/January_20%2C_2007
http://www.mail-archive.com/rails@lists.rubyonrails.org/
http://www.amazon.com/Testing-Equal-Sign-In-Path/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1198861734&sr=8-1
- http://en.wikipedia.org/wiki/Texas_hold'em
https://www.google.com/doku.php?id=gps:resource:scs:start
http://connect.oraclecorp.com/search?search[q]=green+france&search[type]=Group
http://of.openfoundry.org/projects/492/download#4th.Release.3
@@ -269,6 +268,11 @@ def test_auto_link_parsing
urls.each do |url|
assert_equal generate_result(url), auto_link(url)
end
+
+ assert_equal(
+ %{<a href="http://en.wikipedia.org/wiki/Texas_hold'em">http://en.wikipedia.org/wiki/Texas_hold&#39;em</a>},
+ auto_link("http://en.wikipedia.org/wiki/Texas_hold'em")
+ )
end
def generate_result(link_text, href = nil)
Oops, something went wrong.

0 comments on commit 17451c7

Please sign in to comment.