Sha256: d6d2672894eef9e10e52e55db0517f611e4a575ff69bb80407c5632b2f06b288

Contents?: true

Size: 596 Bytes

Versions: 78

Compression:

Stored size: 596 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

shared_examples_for "publicable" do
  let(:factory_name) { described_class.name.demodulize.underscore.to_sym }

  let!(:published) do
    create(factory_name, published_at: Time.current)
  end

  let!(:unpublished) do
    create(factory_name, published_at: nil)
  end

  describe ".published" do
    let(:scope) { described_class.send(:published) }

    it { expect(scope).to eq([published]) }
  end

  describe ".unpublished" do
    let(:scope) { described_class.send(:unpublished) }

    it { expect(scope).to eq([unpublished]) }
  end
end

Version data entries

78 entries across 78 versions & 1 rubygems

Version Path
decidim-core-0.26.8 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.27.4 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.27.3 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.26.7 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.26.5 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.27.2 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.27.1 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.26.4 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.27.0 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.26.3 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.27.0.rc2 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.27.0.rc1 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.26.2 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.26.1 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.26.0 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.26.0.rc2 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.26.0.rc1 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.25.2 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.25.1 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.25.0 lib/decidim/core/test/shared_examples/publicable.rb