padrino-helpers 0.9.10 → 0.9.11
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +4 -51
- data/lib/padrino-helpers.rb +16 -14
- data/lib/padrino-helpers/asset_tag_helpers.rb +26 -9
- data/lib/padrino-helpers/form_helpers.rb +4 -3
- data/lib/padrino-helpers/format_helpers.rb +3 -12
- data/lib/padrino-helpers/locale/cz.yml +103 -0
- data/lib/padrino-helpers/locale/da.yml +13 -13
- data/lib/padrino-helpers/locale/de.yml +14 -14
- data/lib/padrino-helpers/locale/en.yml +13 -13
- data/lib/padrino-helpers/locale/es.yml +103 -0
- data/lib/padrino-helpers/locale/fr.yml +13 -13
- data/lib/padrino-helpers/locale/it.yml +12 -12
- data/lib/padrino-helpers/locale/pt_br.yml +13 -13
- data/lib/padrino-helpers/locale/ru.yml +13 -13
- data/lib/padrino-helpers/locale/tr.yml +103 -0
- data/lib/padrino-helpers/locale/uk.yml +103 -0
- data/padrino-helpers.gemspec +15 -106
- data/test/fixtures/render_app/app.rb +1 -0
- data/test/helper.rb +11 -13
- data/test/test_asset_tag_helpers.rb +26 -0
- data/test/test_form_builder.rb +25 -14
- data/test/test_form_helpers.rb +20 -6
- data/test/test_format_helpers.rb +6 -3
- metadata +72 -28
data/padrino-helpers.gemspec
CHANGED
@@ -1,113 +1,22 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
# -*- encoding: utf-8 -*-
|
1
|
+
require File.expand_path("../../padrino-core/lib/padrino-core/version.rb", __FILE__)
|
2
|
+
require 'rubygems'
|
3
|
+
require 'bundler'
|
5
4
|
|
6
5
|
Gem::Specification.new do |s|
|
7
6
|
s.name = %q{padrino-helpers}
|
8
|
-
s.
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
7
|
+
s.rubyforge_project = %q{padrino-helpers}
|
11
8
|
s.authors = ["Padrino Team", "Nathan Esquenazi", "Davide D'Agostino", "Arthur Chiu"]
|
12
|
-
s.date = %q{2010-04-22}
|
13
|
-
s.description = %q{Tag helpers, asset helpers, form helpers, form builders and many more helpers for padrino}
|
14
9
|
s.email = %q{padrinorb@gmail.com}
|
15
|
-
s.
|
16
|
-
"README.rdoc"
|
17
|
-
]
|
18
|
-
s.files = [
|
19
|
-
".document",
|
20
|
-
".gitignore",
|
21
|
-
"LICENSE",
|
22
|
-
"README.rdoc",
|
23
|
-
"Rakefile",
|
24
|
-
"lib/padrino-helpers.rb",
|
25
|
-
"lib/padrino-helpers/asset_tag_helpers.rb",
|
26
|
-
"lib/padrino-helpers/form_builder/abstract_form_builder.rb",
|
27
|
-
"lib/padrino-helpers/form_builder/standard_form_builder.rb",
|
28
|
-
"lib/padrino-helpers/form_helpers.rb",
|
29
|
-
"lib/padrino-helpers/format_helpers.rb",
|
30
|
-
"lib/padrino-helpers/locale/da.yml",
|
31
|
-
"lib/padrino-helpers/locale/de.yml",
|
32
|
-
"lib/padrino-helpers/locale/en.yml",
|
33
|
-
"lib/padrino-helpers/locale/fr.yml",
|
34
|
-
"lib/padrino-helpers/locale/it.yml",
|
35
|
-
"lib/padrino-helpers/locale/pt_br.yml",
|
36
|
-
"lib/padrino-helpers/locale/ru.yml",
|
37
|
-
"lib/padrino-helpers/number_helpers.rb",
|
38
|
-
"lib/padrino-helpers/output_helpers.rb",
|
39
|
-
"lib/padrino-helpers/render_helpers.rb",
|
40
|
-
"lib/padrino-helpers/tag_helpers.rb",
|
41
|
-
"lib/padrino-helpers/translation_helpers.rb",
|
42
|
-
"padrino-helpers.gemspec",
|
43
|
-
"test/fixtures/markup_app/app.rb",
|
44
|
-
"test/fixtures/markup_app/views/capture_concat.erb",
|
45
|
-
"test/fixtures/markup_app/views/capture_concat.haml",
|
46
|
-
"test/fixtures/markup_app/views/content_for.erb",
|
47
|
-
"test/fixtures/markup_app/views/content_for.haml",
|
48
|
-
"test/fixtures/markup_app/views/content_tag.erb",
|
49
|
-
"test/fixtures/markup_app/views/content_tag.haml",
|
50
|
-
"test/fixtures/markup_app/views/fields_for.erb",
|
51
|
-
"test/fixtures/markup_app/views/fields_for.haml",
|
52
|
-
"test/fixtures/markup_app/views/form_for.erb",
|
53
|
-
"test/fixtures/markup_app/views/form_for.haml",
|
54
|
-
"test/fixtures/markup_app/views/form_tag.erb",
|
55
|
-
"test/fixtures/markup_app/views/form_tag.haml",
|
56
|
-
"test/fixtures/markup_app/views/link_to.erb",
|
57
|
-
"test/fixtures/markup_app/views/link_to.haml",
|
58
|
-
"test/fixtures/markup_app/views/mail_to.erb",
|
59
|
-
"test/fixtures/markup_app/views/mail_to.haml",
|
60
|
-
"test/fixtures/markup_app/views/meta_tag.erb",
|
61
|
-
"test/fixtures/markup_app/views/meta_tag.haml",
|
62
|
-
"test/fixtures/render_app/app.rb",
|
63
|
-
"test/fixtures/render_app/views/erb/test.erb",
|
64
|
-
"test/fixtures/render_app/views/haml/test.haml",
|
65
|
-
"test/fixtures/render_app/views/template/_user.haml",
|
66
|
-
"test/fixtures/render_app/views/template/haml_template.haml",
|
67
|
-
"test/fixtures/render_app/views/template/some_template.haml",
|
68
|
-
"test/helper.rb",
|
69
|
-
"test/test_asset_tag_helpers.rb",
|
70
|
-
"test/test_form_builder.rb",
|
71
|
-
"test/test_form_helpers.rb",
|
72
|
-
"test/test_format_helpers.rb",
|
73
|
-
"test/test_number_helpers.rb",
|
74
|
-
"test/test_output_helpers.rb",
|
75
|
-
"test/test_render_helpers.rb",
|
76
|
-
"test/test_tag_helpers.rb"
|
77
|
-
]
|
10
|
+
s.summary = %q{Helpers for padrino}
|
78
11
|
s.homepage = %q{http://github.com/padrino/padrino-framework/tree/master/padrino-helpers}
|
12
|
+
s.description = %q{Tag helpers, asset helpers, form helpers, form builders and many more helpers for padrino}
|
13
|
+
s.required_rubygems_version = ">= 1.3.6"
|
14
|
+
s.version = Padrino.version
|
15
|
+
s.date = Time.now.strftime("%Y-%m-%d")
|
16
|
+
s.extra_rdoc_files = Dir["*.rdoc"]
|
17
|
+
s.files = %w(.document .gitignore LICENSE README.rdoc Rakefile padrino-helpers.gemspec) + Dir.glob("{bin,lib,test}/**/*")
|
79
18
|
s.rdoc_options = ["--charset=UTF-8"]
|
80
|
-
s.
|
81
|
-
s.
|
82
|
-
s.
|
83
|
-
|
84
|
-
|
85
|
-
if s.respond_to? :specification_version then
|
86
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
87
|
-
s.specification_version = 3
|
88
|
-
|
89
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
90
|
-
s.add_runtime_dependency(%q<padrino-core>, ["= 0.9.10"])
|
91
|
-
s.add_development_dependency(%q<haml>, [">= 2.2.1"])
|
92
|
-
s.add_development_dependency(%q<shoulda>, [">= 2.10.3"])
|
93
|
-
s.add_development_dependency(%q<mocha>, [">= 0.9.7"])
|
94
|
-
s.add_development_dependency(%q<rack-test>, [">= 0.5.0"])
|
95
|
-
s.add_development_dependency(%q<webrat>, [">= 0.5.1"])
|
96
|
-
else
|
97
|
-
s.add_dependency(%q<padrino-core>, ["= 0.9.10"])
|
98
|
-
s.add_dependency(%q<haml>, [">= 2.2.1"])
|
99
|
-
s.add_dependency(%q<shoulda>, [">= 2.10.3"])
|
100
|
-
s.add_dependency(%q<mocha>, [">= 0.9.7"])
|
101
|
-
s.add_dependency(%q<rack-test>, [">= 0.5.0"])
|
102
|
-
s.add_dependency(%q<webrat>, [">= 0.5.1"])
|
103
|
-
end
|
104
|
-
else
|
105
|
-
s.add_dependency(%q<padrino-core>, ["= 0.9.10"])
|
106
|
-
s.add_dependency(%q<haml>, [">= 2.2.1"])
|
107
|
-
s.add_dependency(%q<shoulda>, [">= 2.10.3"])
|
108
|
-
s.add_dependency(%q<mocha>, [">= 0.9.7"])
|
109
|
-
s.add_dependency(%q<rack-test>, [">= 0.5.0"])
|
110
|
-
s.add_dependency(%q<webrat>, [">= 0.5.1"])
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
19
|
+
s.require_path = 'lib'
|
20
|
+
s.add_runtime_dependency(%q<padrino-core>, ["= #{Padrino.version}"])
|
21
|
+
s.add_bundler_dependencies :helpers, :development
|
22
|
+
end
|
data/test/helper.rb
CHANGED
@@ -1,24 +1,22 @@
|
|
1
|
-
require '
|
1
|
+
require File.expand_path('../../../load_paths', __FILE__)
|
2
2
|
require 'test/unit'
|
3
3
|
require 'shoulda'
|
4
4
|
require 'mocha'
|
5
5
|
require 'rack/test'
|
6
6
|
require 'webrat'
|
7
|
-
|
8
|
-
# We try to load the vendored padrino-core if exist
|
9
|
-
%w(core).each do |lib|
|
10
|
-
if File.exist?(File.dirname(__FILE__) + "/../../padrino-#{lib}/lib")
|
11
|
-
$:.unshift File.dirname(__FILE__) + "/../../padrino-#{lib}/lib"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
7
|
require 'padrino-helpers'
|
16
8
|
|
17
9
|
# We need some extension for do our tests
|
18
|
-
|
19
|
-
|
20
|
-
require 'active_support/core_ext/
|
21
|
-
require 'active_support/
|
10
|
+
begin
|
11
|
+
# As 2.3.x
|
12
|
+
require 'active_support/core_ext/date'
|
13
|
+
require 'active_support/core_ext/time'
|
14
|
+
require 'active_support/core_ext/numeric'
|
15
|
+
require 'active_support/duration'
|
16
|
+
rescue LoadError
|
17
|
+
# As 3.x
|
18
|
+
require 'active_support/time'
|
19
|
+
end
|
22
20
|
|
23
21
|
class Test::Unit::TestCase
|
24
22
|
include Padrino::Helpers::OutputHelpers
|
@@ -38,6 +38,18 @@ class TestAssetTagHelpers < Test::Unit::TestCase
|
|
38
38
|
actual_link = link_to('Sign up', :class => "test")
|
39
39
|
assert_has_tag('a', :content => "Sign up", :href => 'javascript:void(0);', :class => 'test') { actual_link }
|
40
40
|
end
|
41
|
+
should "display link element with remote option" do
|
42
|
+
actual_link = link_to('Sign up', '/register', :remote => true)
|
43
|
+
assert_has_tag('a', :content => "Sign up", :href => '/register', 'data-remote' => 'true') { actual_link }
|
44
|
+
end
|
45
|
+
should "display link element with method option" do
|
46
|
+
actual_link = link_to('Sign up', '/register', :method => :delete)
|
47
|
+
assert_has_tag('a', :content => "Sign up", :href => '/register', 'data-method' => 'delete', :rel => 'nofollow') { actual_link }
|
48
|
+
end
|
49
|
+
should "display link element with confirm option" do
|
50
|
+
actual_link = link_to('Sign up', '/register', :confirm => "Are you sure?")
|
51
|
+
assert_has_tag('a', :content => "Sign up", :href => '/register', 'data-confirm' => 'Are you sure?') { actual_link }
|
52
|
+
end
|
41
53
|
should "display link element with ruby block" do
|
42
54
|
actual_link = link_to('/register', :class => 'first', :id => 'binky') { "Sign up" }
|
43
55
|
assert_has_tag('a#binky.first', :content => "Sign up", :href => '/register') { actual_link }
|
@@ -131,6 +143,10 @@ class TestAssetTagHelpers < Test::Unit::TestCase
|
|
131
143
|
assert_has_tag('img.photo', :src => "/images/relative/pic.gif?#{time.to_i}") {
|
132
144
|
image_tag(' relative/ pic.gif ', :class => 'photo') }
|
133
145
|
end
|
146
|
+
should "not use a timestamp if stamp setting is false" do
|
147
|
+
self.class.expects(:asset_stamp).returns(false)
|
148
|
+
assert_has_tag('img', :src => "/absolute/pic.gif") { image_tag('/absolute/pic.gif') }
|
149
|
+
end
|
134
150
|
end
|
135
151
|
|
136
152
|
context 'for #stylesheet_link_tag method' do
|
@@ -166,6 +182,11 @@ class TestAssetTagHelpers < Test::Unit::TestCase
|
|
166
182
|
assert_has_tag('link', :href => "/stylesheets/layout.css?#{time.to_i}") { actual_html }
|
167
183
|
assert_has_tag('link', :href => "http://google.com/style.css") { actual_html }
|
168
184
|
end
|
185
|
+
should "not use a timestamp if stamp setting is false" do
|
186
|
+
self.class.expects(:asset_stamp).returns(false)
|
187
|
+
expected_options = { :media => "screen", :rel => "stylesheet", :type => "text/css" }
|
188
|
+
assert_has_tag('link', expected_options.merge(:href => "/stylesheets/style.css")) { stylesheet_link_tag('style') }
|
189
|
+
end
|
169
190
|
end
|
170
191
|
|
171
192
|
context 'for #javascript_include_tag method' do
|
@@ -208,6 +229,11 @@ class TestAssetTagHelpers < Test::Unit::TestCase
|
|
208
229
|
assert_has_tag('script', :src => "/javascripts/base.js?#{time.to_i}") { actual_html }
|
209
230
|
assert_has_tag('script', :src => "http://google.com/lib.js") { actual_html }
|
210
231
|
end
|
232
|
+
should "not use a timestamp if stamp setting is false" do
|
233
|
+
self.class.expects(:asset_stamp).returns(false)
|
234
|
+
actual_html = javascript_include_tag('application')
|
235
|
+
assert_has_tag('script', :src => "/javascripts/application.js", :type => "text/javascript") { actual_html }
|
236
|
+
end
|
211
237
|
end
|
212
238
|
|
213
239
|
context "for #favicon_tag method" do
|
data/test/test_form_builder.rb
CHANGED
@@ -38,6 +38,17 @@ class TestFormBuilder < Test::Unit::TestCase
|
|
38
38
|
assert_has_tag('form', :action => '/register', :method => 'post') { actual_html }
|
39
39
|
assert_has_tag('form input', :type => 'text', :name => 'outer-user_account[username]') { actual_html }
|
40
40
|
end
|
41
|
+
|
42
|
+
should "display correct form html with remote option" do
|
43
|
+
actual_html = form_for(@user, '/update', :remote => true) { "Demo" }
|
44
|
+
assert_has_tag('form', :action => '/update', :method => 'post', "data-remote" => 'true') { actual_html }
|
45
|
+
end
|
46
|
+
|
47
|
+
should "display correct form html with remote option and method put" do
|
48
|
+
actual_html = form_for(@user, '/update', :remote => true, :method => 'put') { "Demo" }
|
49
|
+
assert_has_tag('form', :method => 'post', "data-method" => 'put', "data-remote" => 'true') { actual_html }
|
50
|
+
assert_has_tag('form input', :type => 'hidden', :name => "_method", :value => 'put') { actual_html }
|
51
|
+
end
|
41
52
|
|
42
53
|
should "display correct form html with method :put" do
|
43
54
|
actual_html = form_for(@user, '/update', :method => 'put') { "Demo" }
|
@@ -130,8 +141,8 @@ class TestFormBuilder < Test::Unit::TestCase
|
|
130
141
|
should "display correct form html with valid record" do
|
131
142
|
actual_html = standard_builder.error_messages(:header_message => "Demo form cannot be saved", :style => "foo:bar", :class => "mine")
|
132
143
|
assert_has_tag('#field-errors h2', :content => "Demo form cannot be saved") { actual_html }
|
133
|
-
assert_has_tag('#field-errors ul li', :content => "
|
134
|
-
assert_has_tag('#field-errors ul li', :content => "
|
144
|
+
assert_has_tag('#field-errors ul li', :content => "B must be valid") { actual_html }
|
145
|
+
assert_has_tag('#field-errors ul li', :content => "A must be present") { actual_html }
|
135
146
|
assert_has_tag('#field-errors', :style => "foo:bar") { actual_html }
|
136
147
|
assert_has_tag('#field-errors', :class => "mine") { actual_html }
|
137
148
|
end
|
@@ -139,26 +150,26 @@ class TestFormBuilder < Test::Unit::TestCase
|
|
139
150
|
should "display correct form in haml" do
|
140
151
|
visit '/haml/form_for'
|
141
152
|
assert_have_selector '#demo div.field-errors h2', :content => "custom MarkupUser cannot be saved!"
|
142
|
-
assert_have_selector '#demo div.field-errors ul li', :content => "
|
143
|
-
assert_have_selector '#demo div.field-errors ul li', :content => "
|
144
|
-
assert_have_selector '#demo div.field-errors ul li', :content => "
|
153
|
+
assert_have_selector '#demo div.field-errors ul li', :content => "Fake must be valid"
|
154
|
+
assert_have_selector '#demo div.field-errors ul li', :content => "Second must be present"
|
155
|
+
assert_have_selector '#demo div.field-errors ul li', :content => "Third must be a number"
|
145
156
|
assert_have_selector '#demo2 div.field-errors h2', :content => "custom MarkupUser cannot be saved!"
|
146
|
-
assert_have_selector '#demo2 div.field-errors ul li', :content => "
|
147
|
-
assert_have_selector '#demo2 div.field-errors ul li', :content => "
|
148
|
-
assert_have_selector '#demo2 div.field-errors ul li', :content => "
|
157
|
+
assert_have_selector '#demo2 div.field-errors ul li', :content => "Fake must be valid"
|
158
|
+
assert_have_selector '#demo2 div.field-errors ul li', :content => "Second must be present"
|
159
|
+
assert_have_selector '#demo2 div.field-errors ul li', :content => "Third must be a number"
|
149
160
|
assert_have_selector '#demo input', :name => 'markup_user[email]', :class => 'invalid'
|
150
161
|
end
|
151
162
|
|
152
163
|
should "display correct form in erb" do
|
153
164
|
visit '/erb/form_for'
|
154
165
|
assert_have_selector '#demo div.field-errors h2', :content => "custom MarkupUser cannot be saved!"
|
155
|
-
assert_have_selector '#demo div.field-errors ul li', :content => "
|
156
|
-
assert_have_selector '#demo div.field-errors ul li', :content => "
|
157
|
-
assert_have_selector '#demo div.field-errors ul li', :content => "
|
166
|
+
assert_have_selector '#demo div.field-errors ul li', :content => "Fake must be valid"
|
167
|
+
assert_have_selector '#demo div.field-errors ul li', :content => "Second must be present"
|
168
|
+
assert_have_selector '#demo div.field-errors ul li', :content => "Third must be a number"
|
158
169
|
assert_have_selector '#demo2 div.field-errors h2', :content => "custom MarkupUser cannot be saved!"
|
159
|
-
assert_have_selector '#demo2 div.field-errors ul li', :content => "
|
160
|
-
assert_have_selector '#demo2 div.field-errors ul li', :content => "
|
161
|
-
assert_have_selector '#demo2 div.field-errors ul li', :content => "
|
170
|
+
assert_have_selector '#demo2 div.field-errors ul li', :content => "Fake must be valid"
|
171
|
+
assert_have_selector '#demo2 div.field-errors ul li', :content => "Second must be present"
|
172
|
+
assert_have_selector '#demo2 div.field-errors ul li', :content => "Third must be a number"
|
162
173
|
assert_have_selector '#demo input', :name => 'markup_user[email]', :class => 'invalid'
|
163
174
|
end
|
164
175
|
end
|
data/test/test_form_helpers.rb
CHANGED
@@ -19,6 +19,18 @@ class TestFormHelpers < Test::Unit::TestCase
|
|
19
19
|
actual_html = form_tag('/register', :class => 'test') { text_field_tag(:username) }
|
20
20
|
assert_has_tag('form input', :type => 'text', :name => "username") { actual_html }
|
21
21
|
end
|
22
|
+
|
23
|
+
should "display correct form with remote" do
|
24
|
+
actual_html = form_tag('/update', :class => 'put-form', :remote => true) { "Demo" }
|
25
|
+
assert_has_tag(:form, :class => "put-form", "data-remote" => 'true') { actual_html }
|
26
|
+
assert_has_no_tag(:form, "data-method" => 'post') { actual_html }
|
27
|
+
end
|
28
|
+
|
29
|
+
should "display correct form with remote and method is put" do
|
30
|
+
actual_html = form_tag('/update', :method => 'put', :remote => true) { "Demo" }
|
31
|
+
assert_has_tag(:form, "data-remote" => 'true', "data-method" => 'put') { actual_html }
|
32
|
+
assert_has_tag('form input', :type => 'hidden', :name => "_method", :value => 'put') { actual_html }
|
33
|
+
end
|
22
34
|
|
23
35
|
should "display correct form with method :put" do
|
24
36
|
actual_html = form_tag('/update', :class => 'put-form', :method => "put") { "Demo" }
|
@@ -93,9 +105,10 @@ class TestFormHelpers < Test::Unit::TestCase
|
|
93
105
|
assert_have_selector 'form.advanced-form .field-errors p', :content => "There were problems with the following fields:"
|
94
106
|
assert_have_selector 'form.advanced-form .field-errors ul'
|
95
107
|
assert_have_selector 'form.advanced-form .field-errors ul li', :count => 4
|
96
|
-
assert_have_selector 'form.advanced-form .field-errors ul li', :content => "
|
97
|
-
assert_have_selector 'form.advanced-form .field-errors ul li', :content => "
|
98
|
-
assert_have_selector 'form.advanced-form .field-errors ul li', :content => "
|
108
|
+
assert_have_selector 'form.advanced-form .field-errors ul li', :content => "Email must be a email"
|
109
|
+
assert_have_selector 'form.advanced-form .field-errors ul li', :content => "Fake must be valid"
|
110
|
+
assert_have_selector 'form.advanced-form .field-errors ul li', :content => "Second must be present"
|
111
|
+
assert_have_selector 'form.advanced-form .field-errors ul li', :content => "Third must be a number"
|
99
112
|
end
|
100
113
|
|
101
114
|
should "display correct error messages list in haml" do
|
@@ -106,9 +119,10 @@ class TestFormHelpers < Test::Unit::TestCase
|
|
106
119
|
assert_have_selector 'form.advanced-form .field-errors p', :content => "There were problems with the following fields:"
|
107
120
|
assert_have_selector 'form.advanced-form .field-errors ul'
|
108
121
|
assert_have_selector 'form.advanced-form .field-errors ul li', :count => 4
|
109
|
-
assert_have_selector 'form.advanced-form .field-errors ul li', :content => "
|
110
|
-
assert_have_selector 'form.advanced-form .field-errors ul li', :content => "
|
111
|
-
assert_have_selector 'form.advanced-form .field-errors ul li', :content => "
|
122
|
+
assert_have_selector 'form.advanced-form .field-errors ul li', :content => "Email must be a email"
|
123
|
+
assert_have_selector 'form.advanced-form .field-errors ul li', :content => "Fake must be valid"
|
124
|
+
assert_have_selector 'form.advanced-form .field-errors ul li', :content => "Second must be present"
|
125
|
+
assert_have_selector 'form.advanced-form .field-errors ul li', :content => "Third must be a number"
|
112
126
|
end
|
113
127
|
end
|
114
128
|
|
data/test/test_format_helpers.rb
CHANGED
@@ -180,13 +180,16 @@ class TestFormatHelpers < Test::Unit::TestCase
|
|
180
180
|
|
181
181
|
context 'for #js_escape_html method' do
|
182
182
|
should "escape double quotes" do
|
183
|
-
assert_equal
|
183
|
+
assert_equal "\\\"hello\\\"", js_escape_html('"hello"')
|
184
184
|
end
|
185
185
|
should "escape single quotes" do
|
186
|
-
assert_equal "
|
186
|
+
assert_equal "\\'hello\\'", js_escape_html("'hello'")
|
187
187
|
end
|
188
188
|
should "escape html tags and breaks" do
|
189
|
-
assert_equal "
|
189
|
+
assert_equal "\\n\\n<p>hello<\\/p>\\n", js_escape_html("\n\r<p>hello</p>\r\n")
|
190
|
+
end
|
191
|
+
should "escape data-confirm attribute" do
|
192
|
+
assert_equal "<data-confirm=\\\"are you sure\\\">", js_escape_html("<data-confirm=\"are you sure\">")
|
190
193
|
end
|
191
194
|
end
|
192
195
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 9
|
8
|
-
-
|
9
|
-
version: 0.9.
|
8
|
+
- 11
|
9
|
+
version: 0.9.11
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Padrino Team
|
@@ -17,69 +17,73 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2010-
|
20
|
+
date: 2010-06-17 00:00:00 -07:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
24
|
name: padrino-core
|
25
|
-
prerelease: false
|
26
25
|
requirement: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
27
|
requirements:
|
28
28
|
- - "="
|
29
29
|
- !ruby/object:Gem::Version
|
30
30
|
segments:
|
31
31
|
- 0
|
32
32
|
- 9
|
33
|
-
-
|
34
|
-
version: 0.9.
|
33
|
+
- 11
|
34
|
+
version: 0.9.11
|
35
35
|
type: :runtime
|
36
|
+
prerelease: false
|
36
37
|
version_requirements: *id001
|
37
38
|
- !ruby/object:Gem::Dependency
|
38
|
-
name:
|
39
|
-
prerelease: false
|
39
|
+
name: i18n
|
40
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
41
42
|
requirements:
|
42
43
|
- - ">="
|
43
44
|
- !ruby/object:Gem::Version
|
44
45
|
segments:
|
45
|
-
-
|
46
|
-
-
|
46
|
+
- 0
|
47
|
+
- 4
|
47
48
|
- 1
|
48
|
-
version:
|
49
|
-
type: :
|
49
|
+
version: 0.4.1
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
50
52
|
version_requirements: *id002
|
51
53
|
- !ruby/object:Gem::Dependency
|
52
|
-
name:
|
53
|
-
prerelease: false
|
54
|
+
name: rake
|
54
55
|
requirement: &id003 !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
55
57
|
requirements:
|
56
58
|
- - ">="
|
57
59
|
- !ruby/object:Gem::Version
|
58
60
|
segments:
|
59
|
-
-
|
60
|
-
-
|
61
|
-
-
|
62
|
-
version:
|
61
|
+
- 0
|
62
|
+
- 8
|
63
|
+
- 7
|
64
|
+
version: 0.8.7
|
63
65
|
type: :development
|
66
|
+
prerelease: false
|
64
67
|
version_requirements: *id003
|
65
68
|
- !ruby/object:Gem::Dependency
|
66
69
|
name: mocha
|
67
|
-
prerelease: false
|
68
70
|
requirement: &id004 !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
69
72
|
requirements:
|
70
73
|
- - ">="
|
71
74
|
- !ruby/object:Gem::Version
|
72
75
|
segments:
|
73
76
|
- 0
|
74
77
|
- 9
|
75
|
-
-
|
76
|
-
version: 0.9.
|
78
|
+
- 8
|
79
|
+
version: 0.9.8
|
77
80
|
type: :development
|
81
|
+
prerelease: false
|
78
82
|
version_requirements: *id004
|
79
83
|
- !ruby/object:Gem::Dependency
|
80
84
|
name: rack-test
|
81
|
-
prerelease: false
|
82
85
|
requirement: &id005 !ruby/object:Gem::Requirement
|
86
|
+
none: false
|
83
87
|
requirements:
|
84
88
|
- - ">="
|
85
89
|
- !ruby/object:Gem::Version
|
@@ -89,11 +93,12 @@ dependencies:
|
|
89
93
|
- 0
|
90
94
|
version: 0.5.0
|
91
95
|
type: :development
|
96
|
+
prerelease: false
|
92
97
|
version_requirements: *id005
|
93
98
|
- !ruby/object:Gem::Dependency
|
94
99
|
name: webrat
|
95
|
-
prerelease: false
|
96
100
|
requirement: &id006 !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
97
102
|
requirements:
|
98
103
|
- - ">="
|
99
104
|
- !ruby/object:Gem::Version
|
@@ -103,7 +108,38 @@ dependencies:
|
|
103
108
|
- 1
|
104
109
|
version: 0.5.1
|
105
110
|
type: :development
|
111
|
+
prerelease: false
|
106
112
|
version_requirements: *id006
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: haml
|
115
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
116
|
+
none: false
|
117
|
+
requirements:
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
segments:
|
121
|
+
- 2
|
122
|
+
- 2
|
123
|
+
- 22
|
124
|
+
version: 2.2.22
|
125
|
+
type: :development
|
126
|
+
prerelease: false
|
127
|
+
version_requirements: *id007
|
128
|
+
- !ruby/object:Gem::Dependency
|
129
|
+
name: shoulda
|
130
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
131
|
+
none: false
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
segments:
|
136
|
+
- 2
|
137
|
+
- 10
|
138
|
+
- 3
|
139
|
+
version: 2.10.3
|
140
|
+
type: :development
|
141
|
+
prerelease: false
|
142
|
+
version_requirements: *id008
|
107
143
|
description: Tag helpers, asset helpers, form helpers, form builders and many more helpers for padrino
|
108
144
|
email: padrinorb@gmail.com
|
109
145
|
executables: []
|
@@ -118,25 +154,29 @@ files:
|
|
118
154
|
- LICENSE
|
119
155
|
- README.rdoc
|
120
156
|
- Rakefile
|
121
|
-
-
|
157
|
+
- padrino-helpers.gemspec
|
122
158
|
- lib/padrino-helpers/asset_tag_helpers.rb
|
123
159
|
- lib/padrino-helpers/form_builder/abstract_form_builder.rb
|
124
160
|
- lib/padrino-helpers/form_builder/standard_form_builder.rb
|
125
161
|
- lib/padrino-helpers/form_helpers.rb
|
126
162
|
- lib/padrino-helpers/format_helpers.rb
|
163
|
+
- lib/padrino-helpers/locale/cz.yml
|
127
164
|
- lib/padrino-helpers/locale/da.yml
|
128
165
|
- lib/padrino-helpers/locale/de.yml
|
129
166
|
- lib/padrino-helpers/locale/en.yml
|
167
|
+
- lib/padrino-helpers/locale/es.yml
|
130
168
|
- lib/padrino-helpers/locale/fr.yml
|
131
169
|
- lib/padrino-helpers/locale/it.yml
|
132
170
|
- lib/padrino-helpers/locale/pt_br.yml
|
133
171
|
- lib/padrino-helpers/locale/ru.yml
|
172
|
+
- lib/padrino-helpers/locale/tr.yml
|
173
|
+
- lib/padrino-helpers/locale/uk.yml
|
134
174
|
- lib/padrino-helpers/number_helpers.rb
|
135
175
|
- lib/padrino-helpers/output_helpers.rb
|
136
176
|
- lib/padrino-helpers/render_helpers.rb
|
137
177
|
- lib/padrino-helpers/tag_helpers.rb
|
138
178
|
- lib/padrino-helpers/translation_helpers.rb
|
139
|
-
- padrino-helpers.
|
179
|
+
- lib/padrino-helpers.rb
|
140
180
|
- test/fixtures/markup_app/app.rb
|
141
181
|
- test/fixtures/markup_app/views/capture_concat.erb
|
142
182
|
- test/fixtures/markup_app/views/capture_concat.haml
|
@@ -181,6 +221,7 @@ rdoc_options:
|
|
181
221
|
require_paths:
|
182
222
|
- lib
|
183
223
|
required_ruby_version: !ruby/object:Gem::Requirement
|
224
|
+
none: false
|
184
225
|
requirements:
|
185
226
|
- - ">="
|
186
227
|
- !ruby/object:Gem::Version
|
@@ -188,16 +229,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
188
229
|
- 0
|
189
230
|
version: "0"
|
190
231
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
232
|
+
none: false
|
191
233
|
requirements:
|
192
234
|
- - ">="
|
193
235
|
- !ruby/object:Gem::Version
|
194
236
|
segments:
|
195
|
-
-
|
196
|
-
|
237
|
+
- 1
|
238
|
+
- 3
|
239
|
+
- 6
|
240
|
+
version: 1.3.6
|
197
241
|
requirements: []
|
198
242
|
|
199
243
|
rubyforge_project: padrino-helpers
|
200
|
-
rubygems_version: 1.3.
|
244
|
+
rubygems_version: 1.3.7
|
201
245
|
signing_key:
|
202
246
|
specification_version: 3
|
203
247
|
summary: Helpers for padrino
|