Sha256: 05a15205055eaf870a1bd85334c7b43f89a332e02d0435e3f94a6188a1c4bb3e

Contents?: true

Size: 915 Bytes

Versions: 2

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 eq 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 eq 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 eq 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

2 entries across 2 versions & 1 rubygems

Version Path
landable-1.14.0 spec/helpers/pages_helper_spec.rb
landable-1.13.2 spec/helpers/pages_helper_spec.rb