Sha256: 8dea5e114122c1be01ba7599078a9304e707ce150c769a4c4555d4718f764932

Contents?: true

Size: 864 Bytes

Versions: 14

Compression:

Stored size: 864 Bytes

Contents

require 'spec_helper'

module Landable::Public::Preview
  describe PagesController do
    routes { Landable::Engine.routes }

    describe '#show' do

      let(:page) { create :page, body: '<p>hello</p>' }

      before(:each) do
        page.publish! author: create(:author)
        page.update_attributes! body: '<p>why hello there</p>'
      end

      def make_request
        get :show, id: page.id
      end

      it 'renders the page in situ' do
        make_request
        response.body.should include '<p>why hello there</p>'
      end

      it 'renders the preview message' do
        make_request
        response.body.should include 'Preview Mode'
      end

      it 'is available at /-/p/:id' do
        assert_recognizes({controller: 'landable/public/preview/pages', action: 'show', id: page.id}, "/-/p/#{page.id}")
      end

    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
landable-1.13.1 spec/controllers/public/preview/pages_controller_spec.rb
landable-1.12.3 spec/controllers/public/preview/pages_controller_spec.rb
landable-1.12.2 spec/controllers/public/preview/pages_controller_spec.rb
landable-1.12.1 spec/controllers/public/preview/pages_controller_spec.rb
landable-1.11.1 spec/controllers/public/preview/pages_controller_spec.rb
landable-1.11.0 spec/controllers/public/preview/pages_controller_spec.rb
landable-1.10.0.rc2 spec/controllers/public/preview/pages_controller_spec.rb
landable-1.10.0.rc1 spec/controllers/public/preview/pages_controller_spec.rb
landable-1.9.2 spec/controllers/public/preview/pages_controller_spec.rb
landable-1.9.1 spec/controllers/public/preview/pages_controller_spec.rb
landable-1.9.0 spec/controllers/public/preview/pages_controller_spec.rb
landable-1.9.0.rc2 spec/controllers/public/preview/pages_controller_spec.rb
landable-1.9.0.rc1 spec/controllers/public/preview/pages_controller_spec.rb
landable-1.8.0 spec/controllers/public/preview/pages_controller_spec.rb