Ticket #498: 498_patch.diff

File 498_patch.diff, 1.5 kB (added by lorenjohnson, 9 months ago)

Fix and related passing unit test.

  • test/unit/standard_tags_test.rb

    old new  
    305305    expected = %{Home Archives <strong>Radius</strong> Docs} 
    306306    assert_renders expected, tags 
    307307  end 
     308  def test_tag_navigation_between_with_empty_nodes 
     309    tags = %{<r:navigation urls="Home: Boy: / | Archives: /archive/ | Radius: /radius/ | Docs: /documentation/"> 
     310               <r:normal><a href="<r:url />"><r:title /></a></r:normal> 
     311               <r:here></r:here> 
     312               <r:selected><strong><a href="<r:url />"><r:title /></a></strong></r:selected> 
     313               <r:between> | </r:between> 
     314             </r:navigation>} 
     315    expected = %{<strong><a href="/">Home: Boy</a></strong> | <a href="/archive/">Archives</a> | <a href="/documentation/">Docs</a>} 
     316    assert_renders expected, tags 
     317  end 
    308318   
    309319  def test_tag_find 
    310320    assert_renders 'Ruby Home Page', %{<r:find url="/"><r:title /></r:find>} 
  • app/models/standard_tags.rb

    old new  
    544544      end 
    545545    end 
    546546    between = hash.has_key?(:between) ? hash[:between].call : ' ' 
    547     result.join(between) 
     547    result.reject { |i| i.blank? }.join(between) 
    548548  end 
    549549  [:normal, :here, :selected, :between].each do |symbol| 
    550550    tag "navigation:#{symbol}" do |tag|