Sha256: 824ca75efa58afc3d6bc713554804de5e8956fa9a617d8d80f7a6bde7860dfc4

Contents?: true

Size: 699 Bytes

Versions: 6

Compression:

Stored size: 699 Bytes

Contents

require 'spec_helper'

describe Gollum::DescendantTree::TreeRenderer do

  it "correctly renders a tree with indexes" do
    tree_renderer = Gollum::DescendantTree::TreeRenderer.new
    expect(tree_renderer.render(tree_with_correct_nesting)).to eq(correct_output)
  end

  def correct_output
    "<ul class='tree'>\n<li><a href='/home/current_page'>Current Page</a><ul>\n<li><a href='/home/current_page/child'>Child</a><ul>\n<li><a href='/home/current_page/child/grandchild'>Grandchild</a><ul>\n<li><a href='/home/current_page/child/grandchild/greatgrandchild'>GreatGrandchild</a></li></ul>\n</li></ul>\n<li><a href='/home/current_page/child_sibling'>Child Sibling</a></ul></li>\n</ul>\n"
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gollum-descendant_tree-0.0.8 spec/lib/gollum/descendant_tree/tree_renderer_spec.rb
gollum-descendant_tree-0.0.7 spec/lib/gollum/descendant_tree/tree_renderer_spec.rb
gollum-descendant_tree-0.0.6 spec/lib/gollum/descendant_tree/tree_renderer_spec.rb
gollum-descendant_tree-0.0.5 spec/lib/gollum/descendant_tree/tree_renderer_spec.rb
gollum-descendant_tree-0.0.4 spec/lib/gollum/descendant_tree/tree_renderer_spec.rb
gollum-descendant_tree-0.0.2 spec/lib/gollum/descendant_tree/tree_renderer_spec.rb