Sha256: 8aaa62a07f46ffd2e09bf1e747fea1e9450fbee79c2192ee9d5b3dfd7107b2f4

Contents?: true

Size: 749 Bytes

Versions: 6

Compression:

Stored size: 749 Bytes

Contents

# frozen_string_literal: true
require "spec_helper"

shared_examples_for "has attachments" do
  context "when it has attachments" do
    let!(:document) do
      Decidim::AttachmentUploader.enable_processing = true
      create(:attachment, :with_pdf, attached_to: attached_to)
    end
    let!(:image) do
      Decidim::AttachmentUploader.enable_processing = true
      create(:attachment, attached_to: attached_to)
    end

    before do
      visit current_path
    end

    it "shows them" do
      within "div.wrapper .documents" do
        expect(page).to have_content(/#{translated(document.title, locale: :en)}/i)
      end

      within "div.wrapper .images" do
        expect(page).to have_css("img.thumbnail")
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-core-0.1.0 lib/decidim/core/test/shared_examples/has_attachments.rb
decidim-core-0.0.8.1 lib/decidim/core/test/shared_examples/has_attachments.rb
decidim-core-0.0.7 lib/decidim/core/test/shared_examples/has_attachments.rb
decidim-core-0.0.6 lib/decidim/core/test/shared_examples/has_attachments.rb
decidim-core-0.0.5 lib/decidim/core/test/shared_examples/has_attachments.rb
decidim-core-0.0.3 lib/decidim/core/test/shared_examples/has_attachments.rb