Sha256: 847159e363da4b07431b919a913ca4e1b2b59b12a92a805016a9c3575653c671

Contents?: true

Size: 1004 Bytes

Versions: 16

Compression:

Stored size: 1004 Bytes

Contents

require 'spec_helper'

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

    describe '#show' do

      let(:author) { create :author }
      let(:page) { create :page, body: '<p>hello</p>' }
      let(:page_revision) do
        page.publish! author: author
        page.revisions.first
      end

      before(:each) do
        # establish the tested-for revision
        page_revision

        2.times do |i|
          page.update_attributes! body: "update #{i}"
          page.publish! author: author
        end
      end

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

      it 'renders the page revision' do
        make_request
        response.body.should include '<p>hello</p>'
      end

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

    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

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