Sha256: 59641383a622d9d8e77908cd7dd2c3503f9f5b74a7650218ac008dd3074d85c8

Contents?: true

Size: 747 Bytes

Versions: 17

Compression:

Stored size: 747 Bytes

Contents

require 'spec_helper'

describe Locomotive::Steam::SectionFinderService do

  let(:repository)  { instance_double('SectionRepository') }
  let(:site)        { instance_double('Site', _id: 1, default_locale: :en, locales: [:en, :fr]) }
  let(:section)     { instance_double('Section') }
  let(:slug)        { 'header' }

  let(:finder) { described_class.new(repository) }

  before do
    allow(repository).to receive(:by_slug).and_return(section)
    allow(repository).to receive(:locale).and_return(:en)
    allow(repository).to receive(:site).and_return(site)
    allow(section).to receive(:localized_attributes).and_return(nil)
  end

  describe '#find' do

    subject { finder.find(slug) }

    it { is_expected.to eq(section) }

  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
locomotivecms_steam-1.8.0.alpha2 spec/unit/services/section_finder_service_spec.rb
locomotivecms_steam-1.8.0.alpha1 spec/unit/services/section_finder_service_spec.rb
locomotivecms_steam-1.7.1 spec/unit/services/section_finder_service_spec.rb
locomotivecms_steam-1.7.0 spec/unit/services/section_finder_service_spec.rb
locomotivecms_steam-1.6.1 spec/unit/services/section_finder_service_spec.rb
locomotivecms_steam-1.6.0 spec/unit/services/section_finder_service_spec.rb
locomotivecms_steam-1.6.0.rc1 spec/unit/services/section_finder_service_spec.rb
locomotivecms_steam-1.6.0.beta1 spec/unit/services/section_finder_service_spec.rb
locomotivecms_steam-1.5.3 spec/unit/services/section_finder_service_spec.rb
locomotivecms_steam-1.5.2 spec/unit/services/section_finder_service_spec.rb
locomotivecms_steam-1.5.1 spec/unit/services/section_finder_service_spec.rb
locomotivecms_steam-1.5.0 spec/unit/services/section_finder_service_spec.rb
locomotivecms_steam-1.5.0.rc1 spec/unit/services/section_finder_service_spec.rb
locomotivecms_steam-1.5.0.rc0 spec/unit/services/section_finder_service_spec.rb
locomotivecms_steam-1.5.0.beta3 spec/unit/services/section_finder_service_spec.rb
locomotivecms_steam-1.5.0.beta2 spec/unit/services/section_finder_service_spec.rb
locomotivecms_steam-1.5.0.beta1 spec/unit/services/section_finder_service_spec.rb