Skip to content

Commit

Permalink
Backport decidim#4811 to 0.16-stable (decidim#4815)
Browse files Browse the repository at this point in the history
* Fix attachments not being inherited and add test

* Add CHANGELOG entry
  • Loading branch information
Aitor Lopez Beltran authored and oriolgual committed Feb 4, 2019
1 parent 99eacbd commit 5c460f7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

**Fixed**:

- **decidim-proposals**: Fix attachments not being inherited from collaborative draft when published as proposal. [\#4815](https://github.com/decidim/decidim/pull/4815)
- **decidim-proposals**: Fix participatory texts error uploading files with accents and special characters. [\#4801](https://github.com/decidim/decidim/pull/4801)
- **decidim-proposals** Public view of Participatory Text is now preserving new lines. [\#4801](https://github.com/decidim/decidim/pull/4801)
- **decidim-core**: Fix action authorizer with blank permissions [\#4746](https://github.com/decidim/decidim/pull/4746)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def create_proposal!
new_proposal = Proposal.new(proposal_attributes)
new_proposal.coauthorships = @collaborative_draft.coauthorships
new_proposal.category = @collaborative_draft.category
new_proposal.attachments = @collaborative_draft.attachments
new_proposal.save!
new_proposal
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ module Proposals
let(:component) { create(:proposal_component) }
let(:state) { :open }
let!(:collaborative_draft) { create(:collaborative_draft, component: component, state: state) }
let!(:attachment) { Decidim::Attachment.create(attachment_params) }
let(:attachment_params) do
{
title: "My attachment",
file: Decidim::Dev.test_file("city.jpeg", "image/jpeg"),
attached_to: collaborative_draft
}
end
let(:current_user) { collaborative_draft.creator_author }
let(:command) { described_class.new(collaborative_draft, current_user) }

Expand Down Expand Up @@ -55,6 +63,7 @@ module Proposals
expect(proposal.category).to eq(collaborative_draft.category)
expect(proposal.scope).to eq(collaborative_draft.scope)
expect(proposal.address).to eq(collaborative_draft.address)
expect(proposal.attachments).to eq(collaborative_draft.attachments)
end
end
end
Expand Down

0 comments on commit 5c460f7

Please sign in to comment.