test/breadcrumbs_test.rb in breadcrumbs-0.1.4 vs test/breadcrumbs_test.rb in breadcrumbs-0.1.5
- old
+ new
@@ -4,10 +4,17 @@
def setup
@breadcrumbs = Breadcrumbs.new
@inline = Breadcrumbs::Render::Inline.new(@breadcrumbs)
end
+ def test_return_safe_html
+ html_mock = mock
+ html_mock.expects(:html_safe).once
+ Breadcrumbs::Render::List.any_instance.stubs(:render).returns(html_mock)
+ @breadcrumbs.render(:format => :list)
+ end
+
def test_add_item
@breadcrumbs.add "Home"
assert_equal 1, @breadcrumbs.items.count
@breadcrumbs << "Home"
@@ -84,9 +91,10 @@
assert_equal "/about", link["href"]
assert_equal "last item-2", items[2]["class"]
assert_equal "People", items[2].inner_text
assert_nil items[2].at("a")
+ assert_not_nil items[2].at("span")
end
def test_render_inline
@breadcrumbs.add "Home", "/", :class => "home"
html = Nokogiri::HTML(@breadcrumbs.render(:format => :inline))