Commit 30270c1ef37b4bf16be55139e3d7203c27ccc943
1 parent
6d5f6b63
Exists in
master
and in
9 other branches
Fix task creation
Showing
2 changed files
with
2 additions
and
2 deletions
Show diff stats
lib/proposals_discussion_plugin/api.rb
... | ... | @@ -27,7 +27,7 @@ class ProposalsDiscussionPlugin::API < Grape::API |
27 | 27 | |
28 | 28 | proposal_task = ProposalsDiscussionPlugin::ProposalTask.new |
29 | 29 | proposal_task.article = params[:article] |
30 | - proposal_task.article[:parent_id] = parent_article.id | |
30 | + proposal_task.article_parent_id = parent_article.id | |
31 | 31 | proposal_task.target = parent_article.profile |
32 | 32 | proposal_task.requestor = current_person |
33 | 33 | ... | ... |
test/unit/api_test.rb
... | ... | @@ -37,7 +37,7 @@ class APITest < ActiveSupport::TestCase |
37 | 37 | should 'suggest article children' do |
38 | 38 | discussion = fast_create(ProposalsDiscussionPlugin::Discussion, :profile_id => user.person.id) |
39 | 39 | topic = fast_create(ProposalsDiscussionPlugin::Topic, :profile_id => user.person.id, :parent_id => discussion.id) |
40 | - params[:article] = {:name => "Proposal name", :body => "Proposal body"} | |
40 | + params[:article] = {:name => "Proposal name", :abstract => "Proposal abstract", :type => 'ProposalsDiscussionPlugin::Proposal'} | |
41 | 41 | assert_difference "ProposalsDiscussionPlugin::ProposalTask.count" do |
42 | 42 | post "/api/v1/proposals_discussion_plugin/#{topic.id}/propose?#{params.to_query}" |
43 | 43 | end | ... | ... |