Sha256: f098dd839b885575f8c04f62144dc852809fb3c1ca44600b5a5bcebc97731213

Contents?: true

Size: 718 Bytes

Versions: 41

Compression:

Stored size: 718 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.before_method('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.before_method('articles')).to eq nil }

  end

end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
locomotivecms_steam-1.0.0.pre.alpha spec/unit/liquid/drops/content_types_spec.rb