Sha256: d6349b4fac06603d91ad94a8a11c7089f03290d18583a166e1a5d288c20848b4

Contents?: true

Size: 1.11 KB

Versions: 9

Compression:

Stored size: 1.11 KB

Contents

# frozen_string_literal: true

shared_examples_for "has embedded video in description" do |description_attribute_name, count: 1|
  let(description_attribute_name) do
    {
      en: <<~HTML
        <p>Description</p>
        <div class="editor-content-videoEmbed" data-video-embed="#{iframe_src}">
          <div>
            <iframe src="#{iframe_src}" title="Test video" frameborder="0"></iframe>
          </div>
        </div>
      HTML
    }
  end
  let(:iframe_src) { "http://www.example.org" }
  let!(:cookie_warning) { "You need to enable all cookies in order to see this content" }

  context "when cookies are rejected" do
    before do
      click_on "Cookie settings"
      click_on "Accept only essential"
    end

    it "disables iframe" do
      expect(page).to have_content(cookie_warning)
      expect(page).to have_no_css("iframe")
    end
  end

  context "when cookies are accepted" do
    before do
      click_on "Cookie settings"
      click_on "Accept all"
    end

    it "shows iframe" do
      expect(page).to have_no_content(cookie_warning)
      expect(page).to have_css("iframe", count:)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
decidim-core-0.30.0.rc2 lib/decidim/core/test/shared_examples/editor_shared_examples.rb
decidim-core-0.30.0.rc1 lib/decidim/core/test/shared_examples/editor_shared_examples.rb
decidim-core-0.29.2 lib/decidim/core/test/shared_examples/editor_shared_examples.rb
decidim-core-0.29.1 lib/decidim/core/test/shared_examples/editor_shared_examples.rb
decidim-core-0.29.0 lib/decidim/core/test/shared_examples/editor_shared_examples.rb
decidim-core-0.29.0.rc4 lib/decidim/core/test/shared_examples/editor_shared_examples.rb
decidim-core-0.29.0.rc3 lib/decidim/core/test/shared_examples/editor_shared_examples.rb
decidim-core-0.29.0.rc2 lib/decidim/core/test/shared_examples/editor_shared_examples.rb
decidim-core-0.29.0.rc1 lib/decidim/core/test/shared_examples/editor_shared_examples.rb