Sha256: ea8d5d0ddd97ebe0b9521e0f331b8385891d3fc8725acfa2251461edf1445b7b

Contents?: true

Size: 992 Bytes

Versions: 2

Compression:

Stored size: 992 Bytes

Contents

require 'spec_helper'

module Landable
  module Public
    module 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
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
landable-1.14.0 spec/controllers/public/preview/pages_controller_spec.rb
landable-1.13.2 spec/controllers/public/preview/pages_controller_spec.rb