Commit 490ba2ad28a9686608c50d4b3231a56b65ffe78e
1 parent
1890177f
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
proposals_discussion: allow creation of discussion with a parent
Showing
2 changed files
with
1 additions
and
7 deletions
Show diff stats
plugins/proposals_discussion/lib/proposals_discussion_plugin.rb
| ... | ... | @@ -17,7 +17,7 @@ class ProposalsDiscussionPlugin < Noosfero::Plugin |
| 17 | 17 | types = [] |
| 18 | 18 | parent_id = context.params[:parent_id] |
| 19 | 19 | parent = parent_id ? context.profile.articles.find(parent_id) : nil |
| 20 | - types << ProposalsDiscussionPlugin::Discussion unless parent | |
| 20 | + types << ProposalsDiscussionPlugin::Discussion | |
| 21 | 21 | types << ProposalsDiscussionPlugin::Topic if parent.kind_of?(ProposalsDiscussionPlugin::Discussion) |
| 22 | 22 | types << ProposalsDiscussionPlugin::Proposal if parent.kind_of?(ProposalsDiscussionPlugin::Topic) |
| 23 | 23 | types | ... | ... |
plugins/proposals_discussion/test/unit/proposals_discussion_plugin_test.rb
| ... | ... | @@ -20,12 +20,6 @@ class ProposalsDiscussionPluginTest < ActiveSupport::TestCase |
| 20 | 20 | assert_includes plugin.content_types, ProposalsDiscussionPlugin::Discussion |
| 21 | 21 | end |
| 22 | 22 | |
| 23 | - should 'do not return Discussion as a content type if it has a parent' do | |
| 24 | - parent = fast_create(Folder, :profile_id => @profile.id) | |
| 25 | - @params[:parent_id] = parent.id | |
| 26 | - assert_not_includes plugin.content_types, ProposalsDiscussionPlugin::Discussion | |
| 27 | - end | |
| 28 | - | |
| 29 | 23 | should 'return Topic as a content type if parent is a Discussion' do |
| 30 | 24 | parent = fast_create(ProposalsDiscussionPlugin::Discussion, :profile_id => @profile.id) |
| 31 | 25 | @params[:parent_id] = parent.id | ... | ... |