Sha256: ec40e4d912cf038fa4405bba214ec24f6270561a057664b63c36a5271ff24a53

Contents?: true

Size: 1.03 KB

Versions: 13

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

require_relative '../../../../../lib/locomotive/steam/adapters/filesystem/yaml_loader.rb'
require_relative '../../../../../lib/locomotive/steam/adapters/filesystem/yaml_loaders/page.rb'

describe Locomotive::Steam::Adapters::Filesystem::YAMLLoaders::Page do

  let(:site_path) { default_fixture_site_path }
  let(:loader)    { described_class.new(site_path) }

  describe '#load' do

    let(:scope) { instance_double('Scope', locale: :fr, default_locale: :en) }

    subject { loader.load(scope).sort { |a, b| a[:_fullpath] <=> b[:_fullpath] } }

    it 'tests various stuff' do
      expect(subject.size).to eq 26
      expect(subject.first[:title]).to eq(en: 'Page not found')
      expect(subject[15][:is_layout]).to eq true
      expect(subject[15][:listed]).to eq false
      expect(subject[15][:published]).to eq false
      expect(subject[16][:slug]).to eq(en: 'music', fr: 'notre-musique')
      expect(subject[17][:_fullpath]).to eq 'songs'
      expect(subject[17][:template_path]).to eq(en: false)
    end

  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
locomotivecms_steam-1.1.0.rc3 spec/unit/adapters/filesystem/yaml_loaders/page_spec.rb
locomotivecms_steam-1.1.0.rc2 spec/unit/adapters/filesystem/yaml_loaders/page_spec.rb
locomotivecms_steam-1.1.0.rc1 spec/unit/adapters/filesystem/yaml_loaders/page_spec.rb
locomotivecms_steam-1.0.1 spec/unit/adapters/filesystem/yaml_loaders/page_spec.rb
locomotivecms_steam-1.0.0 spec/unit/adapters/filesystem/yaml_loaders/page_spec.rb
locomotivecms_steam-1.0.0.rc10 spec/unit/adapters/filesystem/yaml_loaders/page_spec.rb
locomotivecms_steam-1.0.0.rc9 spec/unit/adapters/filesystem/yaml_loaders/page_spec.rb
locomotivecms_steam-1.0.0.rc8 spec/unit/adapters/filesystem/yaml_loaders/page_spec.rb
locomotivecms_steam-1.0.0.rc6 spec/unit/adapters/filesystem/yaml_loaders/page_spec.rb
locomotivecms_steam-1.0.0.rc4 spec/unit/adapters/filesystem/yaml_loaders/page_spec.rb
locomotivecms_steam-1.0.0.rc3 spec/unit/adapters/filesystem/yaml_loaders/page_spec.rb
locomotivecms_steam-1.0.0.rc2 spec/unit/adapters/filesystem/yaml_loaders/page_spec.rb
locomotivecms_steam-1.0.0.rc1 spec/unit/adapters/filesystem/yaml_loaders/page_spec.rb