Sha256: dce423c58d3cbaabbd6e2411412f8d618a5b5983ba00f59098a947711ddaddda

Contents?: true

Size: 762 Bytes

Versions: 2

Compression:

Stored size: 762 Bytes

Contents

require 'spec_helper'

module Landable
  module Api
    describe PageRevisionsController, json: true do
      routes { Landable::Engine.routes }

      describe '#index' do
        include_examples 'Authenticated API controller', :make_request

        let(:page) { create :page }

        def make_request(page_id = page.id)
          get :index, page_id: page_id
        end

        it "returns all of a page's revisions" do
          page.publish! author: current_author
          make_request
          response.status.should eq 200
          last_json['page_revisions'].length.should eq 1
        end

        it '404s on page not found' do
          make_request random_uuid
          response.status.should eq 404
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
landable-1.14.0 spec/controllers/landable/api/page_revisions_controller_spec.rb
landable-1.13.2 spec/controllers/landable/api/page_revisions_controller_spec.rb