breadcrumbs 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/breadcrumbs/render/inline.rb +2 -0
- data/lib/breadcrumbs/render/list.rb +1 -1
- data/lib/breadcrumbs/version.rb +1 -1
- data/lib/breadcrumbs.rb +1 -1
- data/test/breadcrumbs_test.rb +26 -0
- metadata +4 -4
data/lib/breadcrumbs/version.rb
CHANGED
data/lib/breadcrumbs.rb
CHANGED
data/test/breadcrumbs_test.rb
CHANGED
@@ -145,8 +145,34 @@ class BreadcrumbsTest < Test::Unit::TestCase
|
|
145
145
|
assert_equal "Nosso time", items[1].inner_text
|
146
146
|
end
|
147
147
|
|
148
|
+
def test_render_scope_as_text_for_missing_scope
|
149
|
+
@breadcrumbs.add :contact
|
150
|
+
@breadcrumbs.add "Help"
|
151
|
+
|
152
|
+
html = Nokogiri::HTML(@breadcrumbs.render)
|
153
|
+
|
154
|
+
items = html.search("li")
|
155
|
+
|
156
|
+
assert_equal "contact", items[0].inner_text
|
157
|
+
assert_equal "Help", items[1].inner_text
|
158
|
+
end
|
159
|
+
|
148
160
|
def test_pimp_action_controller
|
149
161
|
methods = ActionController::Base.instance_methods
|
150
162
|
assert (methods.include?(:breadcrumbs) || methods.include?("breadcrumbs"))
|
151
163
|
end
|
164
|
+
|
165
|
+
def test_escape_text_when_rendering_inline
|
166
|
+
@breadcrumbs.add "<script>alert(1)</script>"
|
167
|
+
html = @breadcrumbs.render(:format => :inline)
|
168
|
+
|
169
|
+
assert_equal %[<span class="first last item-0"><script>alert(1)</script></span>], html
|
170
|
+
end
|
171
|
+
|
172
|
+
def test_escape_text_when_rendering_list
|
173
|
+
@breadcrumbs.add "<script>alert(1)</script>"
|
174
|
+
html = @breadcrumbs.render
|
175
|
+
|
176
|
+
assert_match /<script>alert\(1\)<\/script>/, html
|
177
|
+
end
|
152
178
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Nando Vieira
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-25 00:00:00 -03:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -50,7 +50,7 @@ files:
|
|
50
50
|
- test/resources/pt.yml
|
51
51
|
- test/test_helper.rb
|
52
52
|
has_rdoc: true
|
53
|
-
homepage: http://github.com/fnando/
|
53
|
+
homepage: http://github.com/fnando/breadcrumbs
|
54
54
|
licenses: []
|
55
55
|
|
56
56
|
post_install_message:
|