Sha256: 7c7cd123bb17fc8282f6b9ad956d92ff33e47f3b37572844c851415825d57813

Contents?: true

Size: 942 Bytes

Versions: 9

Compression:

Stored size: 942 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

describe Decidim::Assemblies::OrganizationPublishedAssemblies do
  subject { described_class.new(organization) }

  let!(:organization) { create(:organization) }

  let!(:published_assemblies) do
    create_list(:assembly, 3, :published, organization: organization)
  end

  let!(:unpublished_assemblies) do
    create_list(:assembly, 3, :unpublished, organization: organization)
  end

  let!(:foreign_assemblies) do
    create_list(:assembly, 3, :published)
  end

  describe "query" do
    it "includes the organization's published assemblies" do
      expect(subject).to include(*published_assemblies)
    end

    it "excludes the organization's unpublished assemblies" do
      expect(subject).not_to include(*unpublished_assemblies)
    end

    it "excludes other organization's published assemblies" do
      expect(subject).not_to include(*foreign_assemblies)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
decidim-0.6.8 decidim-assemblies/spec/queries/organization_published_assemblies_spec.rb
decidim-0.6.7 decidim-assemblies/spec/queries/organization_published_assemblies_spec.rb
decidim-0.6.6 decidim-assemblies/spec/queries/organization_published_assemblies_spec.rb
decidim-0.6.5 decidim-assemblies/spec/queries/organization_published_assemblies_spec.rb
decidim-0.6.4 decidim-assemblies/spec/queries/organization_published_assemblies_spec.rb
decidim-0.6.3 decidim-assemblies/spec/queries/organization_published_assemblies_spec.rb
decidim-0.6.2 decidim-assemblies/spec/queries/organization_published_assemblies_spec.rb
decidim-0.6.1 decidim-assemblies/spec/queries/organization_published_assemblies_spec.rb
decidim-0.6.0 decidim-assemblies/spec/queries/organization_published_assemblies_spec.rb