Sha256: 37f5b5a419007361bb5594cf4be764b65b6d00f8fff004009a6c531e30449f99

Contents?: true

Size: 915 Bytes

Versions: 16

Compression:

Stored size: 915 Bytes

Contents

require 'spec_helper'

module Landable
  describe PagesHelper do
    describe '#current_page' do
      it 'can handle previewing pages' do
        page = create :page
        params[:controller] = 'landable/public/preview/pages'
        params[:id] = page.id

        helper.current_page.should == page
      end

      it 'can handle previewing page_revisions' do
        pr = create :page_revision
        params[:controller] = 'landable/public/preview/page_revisions'
        params[:id] = pr.id

        helper.current_page.should == pr
      end

      it 'can handle viewing published pages' do
        page = create :page
        page.publish! author: create(:author)
        @request.path = page.path

        helper.current_page.should == page
      end

      it "should inherit helpers from the host application" do
        helper.render_hello_world.should eql("hello world")
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
landable-1.13.1 spec/helpers/pages_helper_spec.rb
landable-1.12.3 spec/helpers/pages_helper_spec.rb
landable-1.12.2 spec/helpers/pages_helper_spec.rb
landable-1.12.1 spec/helpers/pages_helper_spec.rb
landable-1.11.1 spec/helpers/pages_helper_spec.rb
landable-1.11.0 spec/helpers/pages_helper_spec.rb
landable-1.10.0.rc2 spec/helpers/pages_helper_spec.rb
landable-1.10.0.rc1 spec/helpers/pages_helper_spec.rb
landable-1.9.2 spec/helpers/pages_helper_spec.rb
landable-1.9.1 spec/helpers/pages_helper_spec.rb
landable-1.9.0 spec/helpers/pages_helper_spec.rb
landable-1.9.0.rc2 spec/helpers/pages_helper_spec.rb
landable-1.9.0.rc1 spec/helpers/pages_helper_spec.rb
landable-1.8.0 spec/helpers/pages_helper_spec.rb
landable-1.7.1.rc1 spec/helpers/pages_helper_spec.rb
landable-1.7.0 spec/helpers/pages_helper_spec.rb