Sha256: 4feaefe17815afa9a77e061a5e23111177f6fc2ac34d2f0cd533af4525c05bdc
Contents?: true
Size: 1.3 KB
Versions: 29
Compression:
Stored size: 1.3 KB
Contents
require 'spec_helper' describe Tenon::Page do let(:page) { Tenon::Page.new } describe '#subpages_for_menu' do context 'a page with no subpages' do before do page.stub(:subpages) { nil } end it 'should find siblings for the menu' do expect(page).to receive(:siblings_for_menu) page.subpages_for_menu end end context 'a page with subpages' do let(:subpages) { double } before do page.stub(:subpages) { subpages } end it 'should grab the subpages that are available for the menu' do expect(subpages).to receive(:for_menu) page.subpages_for_menu end end end describe '#siblings_for_menu' do context 'when the page has no parent' do before do page.stub(:parent) { nil } end it 'should return an empty array' do expect(page.siblings_for_menu).to eq([]) end end context 'when the page has a parent' do let(:parent) { double } before do page.stub(:parent) { parent } end it "should find the parent's subpages" do expect(parent).to receive(:subpages_for_menu) page.siblings_for_menu end end end describe '.reorder' do it 'TODO: Figure out how this works so we can test it.' end end
Version data entries
29 entries across 29 versions & 1 rubygems