Sha256: d29a33e2ebb4a5bc6dbc7f436bd44c3053616aa70d8a205fc1cc4946e39512a5

Contents?: true

Size: 1.81 KB

Versions: 54

Compression:

Stored size: 1.81 KB

Contents

require File.dirname(__FILE__) + '/../integration_helper'

describe Locomotive::Steam::Server do

  include Rack::Test::Methods

  def app
    run_server
  end

  it 'converts {{ page.templatized? }} => true on templatized page' do
    get '/songs/song-number-2'
    expect(last_response.body).to include "templatized='true'"
  end

  it 'converts {{ page.templatized? }} => false on regular page' do
    get '/index'
    expect(last_response.body).to include "templatized='false'"
  end

  it 'converts {{ page.listed? }} => true on listed page' do
    get '/music'
    expect(last_response.body).to include "listed='true'"
  end

  it "provides an access to page's content_type collection" do
    get '/songs/song-number-2'
    expect(last_response.body).to include "content_type_size='8'"
  end

  it 'provides count alias on collections' do
    get '/songs/song-number-2'
    expect(last_response.body).to include "content_type_count='8'"
  end

  describe '.link_to' do

    it 'writes a link to a page' do
      get '/events'
      expect(last_response.body).to include 'Discover: <a href="/music">Music</a>'
    end

    it "writes a localized a link" do
      get '/events'
      expect(last_response.body).to include 'Plus à notre sujet: <a href="/fr/a-notre-sujet">Qui sommes nous ?</a>'
    end

    it "writes a link to a page with a custom label" do
      get '/events'
      expect(last_response.body).to include 'More about us: <a href="/about-us">Who are we ?</a>'
    end

    it "writes a link to a templatized page" do
      get '/events'
      expect(last_response.body).to include '<a href="/songs/song-number-1">Song #1</a>'
    end

    it "writes a link to a templatized page with a different handle" do
      get '/events'
      expect(last_response.body).to include '<a href="/songs/song-number-8">Song #8</a>'
    end

  end

end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
locomotivecms_steam-1.8.0.alpha2 spec/integration/server/liquid_spec.rb
locomotivecms_steam-1.8.0.alpha1 spec/integration/server/liquid_spec.rb
locomotivecms_steam-1.7.1 spec/integration/server/liquid_spec.rb
locomotivecms_steam-1.7.0 spec/integration/server/liquid_spec.rb
locomotivecms_steam-1.6.1 spec/integration/server/liquid_spec.rb
locomotivecms_steam-1.6.0 spec/integration/server/liquid_spec.rb
locomotivecms_steam-1.6.0.rc1 spec/integration/server/liquid_spec.rb
locomotivecms_steam-1.6.0.beta1 spec/integration/server/liquid_spec.rb
locomotivecms_steam-1.5.3 spec/integration/server/liquid_spec.rb
locomotivecms_steam-1.5.2 spec/integration/server/liquid_spec.rb
locomotivecms_steam-1.5.1 spec/integration/server/liquid_spec.rb
locomotivecms_steam-1.5.0 spec/integration/server/liquid_spec.rb
locomotivecms_steam-1.5.0.rc1 spec/integration/server/liquid_spec.rb
locomotivecms_steam-1.5.0.rc0 spec/integration/server/liquid_spec.rb
locomotivecms_steam-1.5.0.beta3 spec/integration/server/liquid_spec.rb
locomotivecms_steam-1.5.0.beta2 spec/integration/server/liquid_spec.rb
locomotivecms_steam-1.5.0.beta1 spec/integration/server/liquid_spec.rb
locomotivecms_steam-1.4.1 spec/integration/server/liquid_spec.rb
locomotivecms_steam-1.4.0 spec/integration/server/liquid_spec.rb
locomotivecms_steam-1.4.0.rc2 spec/integration/server/liquid_spec.rb