forked from decidim/decidim
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/0.28-stable' of github.com:AjuntamentdeBarcelon…
…a/decidim into release/0.28-stable-bcn
- Loading branch information
Showing
12 changed files
with
104 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
decidim-assemblies/spec/system/admin/admin_manages_assembly_landing_page_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
require "spec_helper" | ||
|
||
describe "Admin manages assembly landing page" do | ||
include_context "when admin administrating an assembly" | ||
let!(:resource) { assembly } | ||
let(:scope_name) { :assembly_homepage } | ||
let(:edit_landing_page_path) { decidim_admin_assemblies.edit_assembly_landing_page_path(resource) } | ||
|
||
def edit_content_block_path(resource, content_block) | ||
decidim_admin_assemblies.edit_assembly_landing_page_content_block_path(resource, content_block) | ||
end | ||
|
||
before do | ||
switch_to_host(organization.host) | ||
login_as user, scope: :user | ||
end | ||
|
||
context "when editing related assemblies" do | ||
let!(:related_assemblies_content_block) { create(:content_block, organization:, scope_name: "assembly_homepage", manifest_name: "related_assemblies", scoped_resource_id: resource.id, settings: { "max_results" => "6" }) } | ||
|
||
it "updates the related assemblies content block" do | ||
visit edit_content_block_path(resource, related_assemblies_content_block) | ||
|
||
expect(related_assemblies_content_block.settings["max_results"]).to eq(6) | ||
select 12, from: :content_block_settings_max_results | ||
click_on "Update" | ||
|
||
expect(page).to have_content("Related assemblies") | ||
expect(related_assemblies_content_block.reload.settings["max_results"]).to eq(12) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<div class="wrapper-mini translation-bar"> | ||
<div class="row column"> | ||
<div> | ||
<div class="pt-4 pb-4 text-center bg-background"> | ||
<%= link %> | ||
<span class="translation-button-help"><%= help_text %></span> | ||
<span class="translation-button-help ml-4"><%= help_text %></span> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
decidim-meetings/spec/cells/decidim/meetings/meeting_l_cell_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# frozen_string_literal: true | ||
|
||
require "spec_helper" | ||
|
||
module Decidim::Meetings | ||
describe MeetingLCell, type: :cell do | ||
controller Decidim::Meetings::MeetingsController | ||
include Decidim::SanitizeHelper | ||
|
||
subject { my_cell.call } | ||
|
||
let!(:meeting) { create(:meeting, :published, start_time: Time.new(2020, 10, 15, 10, 4, 5, 0)) } | ||
let(:my_cell) { cell("decidim/meetings/meeting_l", meeting) } | ||
|
||
context "when rendering" do | ||
it "renders the card" do | ||
expect(subject).to have_css("#meetings__meeting_#{meeting.id}.card__calendar-list__reset") | ||
end | ||
|
||
it "shows the start time's month" do | ||
expect(subject).to have_css(".card__calendar-month", text: "Oct") | ||
end | ||
|
||
it "shows the start time's day" do | ||
expect(subject).to have_css(".card__calendar-day", text: "15") | ||
end | ||
|
||
it "shows the start time's year" do | ||
expect(subject).to have_css(".card__calendar-year", text: "2020") | ||
end | ||
end | ||
|
||
context "when title contains special html entities" do | ||
let!(:original_title) { meeting.title["en"] } | ||
|
||
before do | ||
meeting.update!(title: { en: "<strong>#{original_title}</strong> &'<" }) | ||
meeting.reload | ||
end | ||
|
||
it "escapes them correctly" do | ||
title = decidim_html_escape(original_title).gsub(""", '"') | ||
expect(subject.to_s).to include("<strong>#{title}</strong> &'<") | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters