actionpack 2.3.16 → 2.3.17
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.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/lib/action_pack/version.rb +1 -1
- data/test/template/active_record_helper_test.rb +19 -19
- data/test/template/erb_util_test.rb +3 -3
- data/test/template/form_helper_test.rb +10 -10
- data/test/template/text_helper_test.rb +5 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f172719f50d1647a8ff1b79399942bf0dea98eaa
|
4
|
+
data.tar.gz: 672ca9efadfd0f2b7b5143ec33070cf905751591
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c06e97db2037ad4f9b1ad6d8aacf71889891604d1f704ca46eb2704937396c286b40d69c770162fbfb0db2e97189a641800e0941ee3e120e70ab0422a720baeb
|
7
|
+
data.tar.gz: d47aaa462ba919897ff310e49589054368925f85f2a364a28c37bbbc0a7ab0cb6c64ec1ccd134e278453e5695595626145940726d26f5102a1c96b76f11e8d32
|
data/Rakefile
CHANGED
@@ -78,7 +78,7 @@ spec = Gem::Specification.new do |s|
|
|
78
78
|
|
79
79
|
s.requirements << 'none'
|
80
80
|
|
81
|
-
s.add_dependency('activesupport', '= 2.3.
|
81
|
+
s.add_dependency('activesupport', '= 2.3.17' + PKG_BUILD)
|
82
82
|
s.add_dependency('rack', '~> 1.1.0')
|
83
83
|
|
84
84
|
s.require_path = 'lib'
|
data/lib/action_pack/version.rb
CHANGED
@@ -213,15 +213,15 @@ class ActiveRecordHelperTest < ActionView::TestCase
|
|
213
213
|
end
|
214
214
|
|
215
215
|
def test_error_for_block
|
216
|
-
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
|
217
|
-
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
|
218
|
-
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
|
219
|
-
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
|
216
|
+
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")
|
217
|
+
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")
|
218
|
+
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")
|
219
|
+
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")
|
220
220
|
end
|
221
221
|
|
222
222
|
def test_error_messages_for_escapes_html
|
223
223
|
@dirty_post = DirtyPost.new
|
224
|
-
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
|
224
|
+
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 <em>empty</em></li></ul></div>), error_messages_for("dirty_post")
|
225
225
|
end
|
226
226
|
|
227
227
|
def test_error_messages_for_handles_nil
|
@@ -230,7 +230,7 @@ class ActiveRecordHelperTest < ActionView::TestCase
|
|
230
230
|
|
231
231
|
def test_error_message_on_escapes_html
|
232
232
|
@dirty_post = DirtyPost.new
|
233
|
-
assert_dom_equal "<div class=\"formError\">can
|
233
|
+
assert_dom_equal "<div class=\"formError\">can't be <em>empty</em></div>", error_message_on(:dirty_post, :author_name)
|
234
234
|
end
|
235
235
|
|
236
236
|
def test_error_message_on_handles_nil
|
@@ -238,43 +238,43 @@ class ActiveRecordHelperTest < ActionView::TestCase
|
|
238
238
|
end
|
239
239
|
|
240
240
|
def test_error_message_on
|
241
|
-
assert_dom_equal "<div class=\"formError\">can
|
241
|
+
assert_dom_equal "<div class=\"formError\">can't be empty</div>", error_message_on(:post, :author_name)
|
242
242
|
end
|
243
243
|
|
244
244
|
def test_error_message_on_no_instance_variable
|
245
245
|
other_post = @post
|
246
|
-
assert_dom_equal "<div class=\"formError\">can
|
246
|
+
assert_dom_equal "<div class=\"formError\">can't be empty</div>", error_message_on(other_post, :author_name)
|
247
247
|
end
|
248
248
|
|
249
249
|
def test_error_message_on_with_options_hash
|
250
|
-
assert_dom_equal "<div class=\"differentError\">beforecan
|
250
|
+
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')
|
251
251
|
end
|
252
252
|
|
253
253
|
def test_error_messages_for_many_objects
|
254
|
-
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
|
254
|
+
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")
|
255
255
|
|
256
256
|
# reverse the order, error order changes and so does the title
|
257
|
-
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
|
257
|
+
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")
|
258
258
|
|
259
259
|
# add the default to put post back in the title
|
260
|
-
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
|
260
|
+
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")
|
261
261
|
|
262
262
|
# symbols work as well
|
263
|
-
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
|
263
|
+
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)
|
264
264
|
|
265
265
|
# any default works too
|
266
|
-
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
|
266
|
+
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")
|
267
267
|
|
268
268
|
# should space object name
|
269
|
-
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
|
269
|
+
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")
|
270
270
|
|
271
271
|
# hide header and explanation messages with nil or empty string
|
272
|
-
assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><ul><li>User email can
|
272
|
+
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 => "")
|
273
273
|
|
274
274
|
# override header and explanation messages
|
275
275
|
header_message = "Yikes! Some errors"
|
276
276
|
message = "Please fix the following fields and resubmit:"
|
277
|
-
assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>#{header_message}</h2><p>#{message}</p><ul><li>User email can
|
277
|
+
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)
|
278
278
|
end
|
279
279
|
|
280
280
|
def test_error_messages_for_non_instance_variable
|
@@ -284,10 +284,10 @@ class ActiveRecordHelperTest < ActionView::TestCase
|
|
284
284
|
@post = nil
|
285
285
|
|
286
286
|
#explicitly set object
|
287
|
-
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
|
287
|
+
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)
|
288
288
|
|
289
289
|
#multiple objects
|
290
|
-
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
|
290
|
+
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])
|
291
291
|
|
292
292
|
#nil object
|
293
293
|
assert_equal '', error_messages_for('user', :object => nil)
|
@@ -8,7 +8,7 @@ class ErbUtilTest < Test::Unit::TestCase
|
|
8
8
|
assert_equal expected, html_escape(given)
|
9
9
|
end
|
10
10
|
|
11
|
-
unless given == '"'
|
11
|
+
unless given == '"' || given == "'"
|
12
12
|
define_method "test_json_escape_#{expected.gsub /\W/, ''}" do
|
13
13
|
assert_equal ERB::Util::JSON_ESCAPE[given], json_escape(given)
|
14
14
|
end
|
@@ -26,10 +26,10 @@ class ErbUtilTest < Test::Unit::TestCase
|
|
26
26
|
assert_equal "<p>", escaped
|
27
27
|
assert escaped.html_safe?
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
def test_rest_in_ascii
|
31
31
|
(0..127).to_a.map(&:chr).each do |chr|
|
32
|
-
next if %w(& " < >).include?(chr)
|
32
|
+
next if %w(& " < > ').include?(chr)
|
33
33
|
assert_equal chr, html_escape(chr)
|
34
34
|
end
|
35
35
|
end
|
@@ -743,7 +743,7 @@ class FormHelperTest < ActionView::TestCase
|
|
743
743
|
|
744
744
|
assert_dom_equal expected, output_buffer
|
745
745
|
end
|
746
|
-
|
746
|
+
|
747
747
|
def test_nested_fields_for_with_existing_records_on_a_nested_attributes_one_to_one_association_with_explicit_hidden_field_placement
|
748
748
|
@post.author = Author.new(321)
|
749
749
|
|
@@ -754,7 +754,7 @@ class FormHelperTest < ActionView::TestCase
|
|
754
754
|
concat af.text_field(:name)
|
755
755
|
end
|
756
756
|
end
|
757
|
-
|
757
|
+
|
758
758
|
expected = '<form action="http://www.example.com" method="post">' +
|
759
759
|
'<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
|
760
760
|
'<input id="post_author_attributes_id" name="post[author_attributes][id]" type="hidden" value="321" />' +
|
@@ -799,7 +799,7 @@ class FormHelperTest < ActionView::TestCase
|
|
799
799
|
end
|
800
800
|
end
|
801
801
|
end
|
802
|
-
|
802
|
+
|
803
803
|
expected = '<form action="http://www.example.com" method="post">' +
|
804
804
|
'<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
|
805
805
|
'<input id="post_comments_attributes_0_id" name="post[comments_attributes][0][id]" type="hidden" value="1" />' +
|
@@ -1195,8 +1195,8 @@ class FormHelperTest < ActionView::TestCase
|
|
1195
1195
|
end
|
1196
1196
|
|
1197
1197
|
expected = %(<form action='http://www.example.com' method='post'>) +
|
1198
|
-
%(<div class='formError'>can
|
1199
|
-
%(<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
|
1198
|
+
%(<div class='formError'>can't be empty</div>) +
|
1199
|
+
%(<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>) +
|
1200
1200
|
%(</form>)
|
1201
1201
|
|
1202
1202
|
assert_dom_equal expected, output_buffer
|
@@ -1213,14 +1213,14 @@ class FormHelperTest < ActionView::TestCase
|
|
1213
1213
|
end
|
1214
1214
|
|
1215
1215
|
expected = %(<form action='http://www.example.com' method='post'>) +
|
1216
|
-
%(<div class='formError'>can
|
1217
|
-
%(<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
|
1216
|
+
%(<div class='formError'>can't be empty</div>) +
|
1217
|
+
%(<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>) +
|
1218
1218
|
%(</form>)
|
1219
1219
|
|
1220
1220
|
assert_dom_equal expected, output_buffer
|
1221
1221
|
|
1222
1222
|
end
|
1223
|
-
|
1223
|
+
|
1224
1224
|
def test_default_form_builder_without_object
|
1225
1225
|
|
1226
1226
|
form_for(:post) do |f|
|
@@ -1229,8 +1229,8 @@ class FormHelperTest < ActionView::TestCase
|
|
1229
1229
|
end
|
1230
1230
|
|
1231
1231
|
expected = %(<form action='http://www.example.com' method='post'>) +
|
1232
|
-
%(<div class='formError'>can
|
1233
|
-
%(<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
|
1232
|
+
%(<div class='formError'>can't be empty</div>) +
|
1233
|
+
%(<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>) +
|
1234
1234
|
%(</form>)
|
1235
1235
|
|
1236
1236
|
assert_dom_equal expected, output_buffer
|
@@ -259,7 +259,6 @@ class TextHelperTest < ActionView::TestCase
|
|
259
259
|
http://en.wikipedia.org/wiki/Wikipedia:Today%27s_featured_picture_%28animation%29/January_20%2C_2007
|
260
260
|
http://www.mail-archive.com/rails@lists.rubyonrails.org/
|
261
261
|
http://www.amazon.com/Testing-Equal-Sign-In-Path/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1198861734&sr=8-1
|
262
|
-
http://en.wikipedia.org/wiki/Texas_hold'em
|
263
262
|
https://www.google.com/doku.php?id=gps:resource:scs:start
|
264
263
|
http://connect.oraclecorp.com/search?search[q]=green+france&search[type]=Group
|
265
264
|
http://of.openfoundry.org/projects/492/download#4th.Release.3
|
@@ -269,6 +268,11 @@ class TextHelperTest < ActionView::TestCase
|
|
269
268
|
urls.each do |url|
|
270
269
|
assert_equal generate_result(url), auto_link(url)
|
271
270
|
end
|
271
|
+
|
272
|
+
assert_equal(
|
273
|
+
%{<a href="http://en.wikipedia.org/wiki/Texas_hold'em">http://en.wikipedia.org/wiki/Texas_hold'em</a>},
|
274
|
+
auto_link("http://en.wikipedia.org/wiki/Texas_hold'em")
|
275
|
+
)
|
272
276
|
end
|
273
277
|
|
274
278
|
def generate_result(link_text, href = nil)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.3.
|
19
|
+
version: 2.3.17
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.3.
|
26
|
+
version: 2.3.17
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -506,7 +506,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
506
506
|
requirements:
|
507
507
|
- none
|
508
508
|
rubyforge_project: actionpack
|
509
|
-
rubygems_version: 2.0.0.
|
509
|
+
rubygems_version: 2.0.0.rc.2
|
510
510
|
signing_key:
|
511
511
|
specification_version: 4
|
512
512
|
summary: Web-flow and rendering framework putting the VC in MVC.
|