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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport 'Fix for exporting hidden moderated proposals' to v0.26 #10660

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions decidim-proposals/lib/decidim/proposals/component.rb
Expand Up @@ -131,6 +131,7 @@

collection = Decidim::Proposals::Proposal
.published
.not_hidden
.where(component: component_instance)
.includes(:scope, :category, :component)

Expand Down
14 changes: 14 additions & 0 deletions decidim-proposals/spec/lib/decidim/proposals/component_spec.rb
Expand Up @@ -274,5 +274,19 @@
expect(subject).to match_array([unassigned_proposal, assigned_proposal])
end
end

context "when proposal is moderated" do
let(:hidden_proposal) { create :proposal, component: component }
let!(:moderation) { create(:moderation, hidden_at: 6.hours.ago, reportable: hidden_proposal) }
let!(:user) { create :user, admin: true, organization: organization }

it "exports all proposals from the component" do
expect(subject).to include(unassigned_proposal, assigned_proposal)
end

it "excludes the hidden proposals" do
expect(subject).not_to include(hidden_proposal)
end
end
end
end