moved to the listed methods in the nav

This commit is contained in:
Dirk Kelly 2011-02-01 16:07:56 +08:00
parent 974923b929
commit 7bce392e56
2 changed files with 2 additions and 2 deletions

View File

@ -106,7 +106,7 @@ module Locomotive
# Determines whether or not a page should be a part of the menu
def include_page?(page)
if page.unlisted? || page.templatized? || !page.published?
if !page.listed? || page.templatized? || !page.published?
false
elsif @options[:exclude]
(page.fullpath =~ @options[:exclude]).nil?

View File

@ -16,7 +16,7 @@ describe Locomotive::Liquid::Tags::Nav do
Page.new(:title => 'Child #2.2', :fullpath => 'child_2/sub_child_2', :slug => 'sub_child_2', :published => true),
Page.new(:title => 'Unpublished #2.2', :fullpath => 'child_2/sub_child_unpublishd_2', :slug => 'sub_child_unpublished_2', :published => false),
Page.new(:title => 'Templatized #2.3', :fullpath => 'child_2/sub_child_template_3', :slug => 'sub_child_template_3', :published => true, :templatized => true),
Page.new(:title => 'Unlisted #2.4', :fullpath => 'child_2/sub_child_unlisted_4', :slug => 'sub_child_unlisted_4', :published => true, :unlisted => true)
Page.new(:title => 'Unlisted #2.4', :fullpath => 'child_2/sub_child_unlisted_4', :slug => 'sub_child_unlisted_4', :published => true, :listed => false)
]
@home.children.last.stubs(:children_with_minimal_attributes).returns(other_children)
@home.children.last.stubs(:children).returns(other_children)