Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix conference view to allow images from admin and spec file #110

Merged
merged 10 commits into from
Aug 12, 2024
4 changes: 2 additions & 2 deletions app/views/decidim/conferences/conferences/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ edit_link(
<div class="columns mediumlarge-12">
<section class="section">
<h3 class="section-heading"><%= t("conferences.show.introduction", scope: "decidim") %></h3>
<%= decidim_sanitize translated_attribute(current_participatory_space.short_description) %>
<%= decidim_sanitize_editor_admin translated_attribute(current_participatory_space.short_description) %>
</section>
<hr class="reset mt-none mb-m">
<section class="section">
<h3 class="section-heading"><%= t("conferences.show.details", scope: "decidim") %></h3>
<%= decidim_sanitize translated_attribute(current_participatory_space.description) %>
<%= decidim_sanitize_editor_admin translated_attribute(current_participatory_space.description) %>
<div class="row mt-l mb-l">
<div class="column medium-9 medium-centered">
<% if current_participatory_space.registrations_enabled? %>
Expand Down
1 change: 1 addition & 0 deletions spec/factories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
require "decidim/core/test/factories"
require "decidim/proposals/test/factories"
require "decidim/decidim_awesome/test/factories"
require "decidim/conferences/test/factories"
20 changes: 20 additions & 0 deletions spec/system/conferences_with_image_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

require "rails_helper"

describe "Conference with images", type: :system do
let(:organization) { create :organization }
let(:short_description) { { en: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><img src=\"/favicon.ico\">" } }
let!(:conference) { create :conference, organization: organization, short_description: short_description }

before do
switch_to_host(organization.host)
page.visit "/conferences/#{conference.slug}"
end

it "shows the image" do
within "#content" do
expect(page).to have_xpath("//img[contains(@src,'favicon.ico')]")
end
end
end
Loading