Sha256: a65725278de45b935e9073adb6d5449d38cffb93e3d2d1c848ca168af14e1399

Contents?: true

Size: 734 Bytes

Versions: 13

Compression:

Stored size: 734 Bytes

Contents

require 'spec_helper'

describe Locomotive::Steam::Liquid::Drops::ContentTypes do

  let(:services)  { Locomotive::Steam::Services.build_instance }
  let(:context)   { ::Liquid::Context.new({}, {}, { services: services }) }
  let(:drop)      { described_class.new.tap { |d| d.context = context } }

  before do
    allow(services.repositories.content_type).to receive(:by_slug).with('articles').and_return(true)
  end

  it { expect(drop.liquid_method_missing('articles')).not_to eq nil }

  context 'content type not found' do

    before do
      allow(services.repositories.content_type).to receive(:by_slug).with('articles').and_return(nil)
    end

    it { expect(drop.liquid_method_missing('articles')).to eq nil }

  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
locomotivecms_steam-1.8.0.alpha2 spec/unit/liquid/drops/content_types_spec.rb
locomotivecms_steam-1.8.0.alpha1 spec/unit/liquid/drops/content_types_spec.rb
locomotivecms_steam-1.7.1 spec/unit/liquid/drops/content_types_spec.rb
locomotivecms_steam-1.7.0 spec/unit/liquid/drops/content_types_spec.rb
locomotivecms_steam-1.6.1 spec/unit/liquid/drops/content_types_spec.rb
locomotivecms_steam-1.6.0 spec/unit/liquid/drops/content_types_spec.rb
locomotivecms_steam-1.6.0.rc1 spec/unit/liquid/drops/content_types_spec.rb
locomotivecms_steam-1.6.0.beta1 spec/unit/liquid/drops/content_types_spec.rb
locomotivecms_steam-1.5.3 spec/unit/liquid/drops/content_types_spec.rb
locomotivecms_steam-1.5.2 spec/unit/liquid/drops/content_types_spec.rb
locomotivecms_steam-1.5.1 spec/unit/liquid/drops/content_types_spec.rb
locomotivecms_steam-1.5.0 spec/unit/liquid/drops/content_types_spec.rb
locomotivecms_steam-1.5.0.rc1 spec/unit/liquid/drops/content_types_spec.rb