Sha256: ffa321d69d04baba1459bae05d4d59af02e109e4de6b1b683e30b0b3321ddb74

Contents?: true

Size: 869 Bytes

Versions: 20

Compression:

Stored size: 869 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

module Decidim
  module Comments
    describe Export do
      let(:subject) { described_class }
      let!(:feature) { create(:feature, manifest_name: "dummy") }
      let!(:dummy_resources) { create_list(:dummy_resource, 2, feature: feature) }
      let!(:comments) { create_list(:comment, 5, commentable: dummy_resources[1], root_commentable: dummy_resources[1]) }
      let!(:other_comments) { create_list(:comment, 5) }

      describe "#comments_for_resource" do
        let(:collection) { subject.comments_for_resource(Decidim::DummyResource, feature) }

        it "returns a collection of comments" do
          expect(collection).to include(*comments)
        end

        it "excludes other comments" do
          expect(collection).to_not include(*other_comments)
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
decidim-0.6.8 decidim-comments/spec/lib/export_spec.rb
decidim-0.6.7 decidim-comments/spec/lib/export_spec.rb
decidim-0.6.6 decidim-comments/spec/lib/export_spec.rb
decidim-0.6.5 decidim-comments/spec/lib/export_spec.rb
decidim-0.6.4 decidim-comments/spec/lib/export_spec.rb
decidim-0.6.3 decidim-comments/spec/lib/export_spec.rb
decidim-0.6.2 decidim-comments/spec/lib/export_spec.rb
decidim-0.6.1 decidim-comments/spec/lib/export_spec.rb
decidim-0.6.0 decidim-comments/spec/lib/export_spec.rb
decidim-0.5.1 decidim-comments/spec/lib/export_spec.rb
decidim-0.5.0 decidim-comments/spec/lib/export_spec.rb
decidim-0.4.4 decidim-comments/spec/lib/export_spec.rb
decidim-0.4.3 decidim-comments/spec/lib/export_spec.rb
decidim-0.4.2 decidim-comments/spec/lib/export_spec.rb
decidim-0.4.1 decidim-comments/spec/lib/export_spec.rb
decidim-0.4.0 decidim-comments/spec/lib/export_spec.rb
decidim-0.3.2 decidim-comments/spec/lib/export_spec.rb
decidim-0.3.1 decidim-comments/spec/lib/export_spec.rb
decidim-0.3.0 decidim-comments/spec/lib/export_spec.rb
decidim-0.2.0 decidim-comments/spec/lib/export_spec.rb