Sha256: 5c02f386220ddefaf0e2aca292e8ba86ef23b6f01eb2a5cd14a0a86d65b77a06

Contents?: true

Size: 957 Bytes

Versions: 7

Compression:

Stored size: 957 Bytes

Contents

require 'spec_helper'

describe Alephant::Preview::Server do
  include Rack::Test::Methods

  def app
    Alephant::Preview::Server
  end

  describe '/preview/:id/:template/:region/?:fixture?' do
    context 'valid component' do
      it "should return the rendered component inside the page region specified" do
        get '/preview/foo/foo/page_region/foo'

        expect(last_response).to be_ok
        expect(last_response.body).to eq("topcontent\nbottom\n")
      end
    end
  end

  describe '/component/:id/:template/?:fixture?' do
    context 'valid component' do
      it "should return the rendered component" do
        get '/component/foo/foo/foo'

        expect(last_response).to be_ok
        expect(last_response.body).to eq("content\n")
      end
    end
  end

  describe '/status' do
    it "responds with ok" do
      get '/status'

      expect(last_response).to be_ok
      expect(last_response.body).to eq('ok')
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
alephant-preview-0.2.0 spec/preview_spec.rb
alephant-preview-0.1.2 spec/preview_spec.rb
alephant-preview-0.1.1 spec/preview_spec.rb
alephant-preview-0.1.0 spec/preview_spec.rb
alephant-preview-0.0.7 spec/preview_spec.rb
alephant-preview-0.0.6 spec/preview_spec.rb
alephant-preview-0.0.5.4 spec/preview_spec.rb