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.29.1 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.28.4 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.27.9 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.29.0 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.28.3 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.27.8 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.29.0.rc4 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.29.0.rc3 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.29.0.rc2 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.29.0.rc1 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.28.2 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.27.7 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.28.1 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.27.6 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.26.10 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.26.9 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.28.0 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.27.5 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.28.0.rc5 lib/decidim/core/test/shared_examples/publicable.rb
decidim-core-0.28.0.rc4 lib/decidim/core/test/shared_examples/publicable.rb