Sha256: d9eb922741ecdf0903af36d208d7a65feeb1f01da5cdde6bab857f643ac65d4e

Contents?: true

Size: 941 Bytes

Versions: 54

Compression:

Stored size: 941 Bytes

Contents

require 'spec_helper'

require_relative '../../../lib/locomotive/steam/adapters/filesystem.rb'

describe Locomotive::Steam::SiteRepository do

  let(:adapter)     { Locomotive::Steam::FilesystemAdapter.new(nil) }
  let(:repository)  { described_class.new(adapter) }

  before do
    allow(adapter).to receive(:collection).and_return([{ name: 'Acme', handle: 'acme', domains: ['example.org'] }])
    adapter.cache = NoCacheStore.new
  end

  describe '#by_handle_or_domain' do

    let(:handle)  { nil }
    let(:domains) { nil }

    subject { repository.by_handle_or_domain(handle, domains) }

    it { expect(subject).to eq nil }

    context 'handle' do

      let(:handle) { 'acme' }
      it { expect(subject.class).to eq Locomotive::Steam::Site }
      it { expect(subject.name).to eq 'Acme' }

    end

    context 'domain' do

      let(:domains) { 'example.org' }
      it { expect(subject.name).to eq 'Acme' }

    end

  end

end

Version data entries

54 entries across 54 versions & 1 rubygems

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