Skip to content

Commit 93e1a5b

Browse files
committed
Show number of votes in transparent space
1 parent 2f9e55f commit 93e1a5b

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

decidim-proposals/app/cells/decidim/proposals/proposal_vote/show.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<% if !current_settings.votes_hidden? && (current_component.participatory_space.can_participate?(current_user) || current_user&.admin?) %>
1+
<% if (!current_settings.votes_hidden? && (current_component.participatory_space.can_participate?(current_user) || current_user&.admin? || current_component.participatory_space.is_transparent?)) %>
22
<% if component_settings.participatory_texts_enabled? && from_proposals_list %>
33
<%= render partial: "decidim/proposals/proposals/participatory_texts/proposal_votes_count", locals: { proposal: resource, from_proposals_list: true } %>
44
<% else %>

decidim-proposals/app/views/decidim/proposals/proposals/_votes_count.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<% if !current_settings.votes_hidden? && (current_component.participatory_space.can_participate?(current_user) || current_user&.admin?) %>
1+
<% if !current_settings.votes_hidden? && (current_component.participatory_space.can_participate?(current_user) || current_user&.admin? || current_component.participatory_space.is_transparent?) %>
22
<% if component_settings.participatory_texts_enabled? && from_proposals_list %>
33
<%= render partial: "decidim/proposals/proposals/participatory_texts/proposal_votes_count", locals: { proposal:, from_proposals_list: true } %>
44
<% else %>

decidim-proposals/spec/system/transparent_space_proposal_spec.rb

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,19 @@ def visit_component
4444
visit target_path
4545
end
4646

47-
it "can access the page but cannot see the votes" do
47+
it "can access the page and see the votes" do
4848
expect(page).to have_content(proposal.title["en"])
49-
expect(page).to have_no_content("Votes")
49+
expect(page).to have_content("Votes")
50+
end
51+
end
52+
53+
context "when accessing the proposal list page" do
54+
before do
55+
visit_component
56+
end
57+
58+
it "can see the votes" do
59+
expect(page).to have_content("Votes")
5060
end
5161
end
5262
end
@@ -58,7 +68,7 @@ def visit_component
5868
login_as other_user, scope: :user
5969
end
6070

61-
it "not allows create a proposal" do
71+
it "allows create a proposal" do
6272
visit_component
6373

6474
within "aside" do

0 commit comments

Comments
 (0)