Skip to content

Commit

Permalink
Rails 2.3.17
Browse files Browse the repository at this point in the history
Also update TOC test for
new Maruku TOC code.
  • Loading branch information
distler committed Feb 12, 2013
1 parent a0923cd commit 70f3e00
Show file tree
Hide file tree
Showing 27 changed files with 100 additions and 73 deletions.
5 changes: 3 additions & 2 deletions test/unit/page_renderer_test.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion vendor/rails/actionmailer/Rakefile
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions vendor/rails/actionmailer/actionmailer.gemspec
@@ -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.'

Expand All @@ -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 changes: 1 addition & 1 deletion vendor/rails/actionmailer/lib/action_mailer/version.rb
Expand Up @@ -2,7 +2,7 @@ module ActionMailer
module VERSION #:nodoc:
MAJOR = 2
MINOR = 3
TINY = 16
TINY = 17

STRING = [MAJOR, MINOR, TINY].join('.')
end
Expand Down
2 changes: 1 addition & 1 deletion vendor/rails/actionpack/Rakefile
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions vendor/rails/actionpack/actionpack.gemspec
@@ -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.'

Expand All @@ -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 changes: 1 addition & 1 deletion vendor/rails/actionpack/lib/action_pack/version.rb
Expand Up @@ -2,7 +2,7 @@ module ActionPack #:nodoc:
module VERSION #:nodoc:
MAJOR = 2
MINOR = 3
TINY = 16
TINY = 17

STRING = [MAJOR, MINOR, TINY].join('.')
end
Expand Down
38 changes: 19 additions & 19 deletions vendor/rails/actionpack/test/template/active_record_helper_test.rb
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions vendor/rails/actionpack/test/template/erb_util_test.rb
Expand Up @@ -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
Expand All @@ -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
Expand Down
20 changes: 10 additions & 10 deletions vendor/rails/actionpack/test/template/form_helper_test.rb
Expand Up @@ -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)

Expand All @@ -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" />' +
Expand Down Expand Up @@ -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" />' +
Expand Down Expand Up @@ -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
Expand All @@ -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|
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion vendor/rails/actionpack/test/template/text_helper_test.rb
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 70f3e00

Please sign in to comment.