From 1c90aa7a62ecaf19eda99599591d0aa4279ca1aa Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Wed, 16 Sep 2015 14:10:48 -0300 Subject: [PATCH] rename parent parameter to parent_id --- lib/noosfero/api/v1/search.rb | 2 +- test/unit/api/search_test.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/noosfero/api/v1/search.rb b/lib/noosfero/api/v1/search.rb index 9140d92..3fed86a 100644 --- a/lib/noosfero/api/v1/search.rb +++ b/lib/noosfero/api/v1/search.rb @@ -19,7 +19,7 @@ module Noosfero scope = scope.where(:type => params[:type]) if params[:type] && !(params[:type] == 'Article') - scope = scope.where(:parent_id => params[:parent]) if params[:parent].present? + scope = scope.where(:parent_id => params[:parent_id]) if params[:parent_id].present? category = params[:category] || "" diff --git a/test/unit/api/search_test.rb b/test/unit/api/search_test.rb index b32e2f4..8f2cfef 100644 --- a/test/unit/api/search_test.rb +++ b/test/unit/api/search_test.rb @@ -110,11 +110,11 @@ class SearchTest < ActiveSupport::TestCase parent = fast_create(Folder, :profile_id => person.id, :name => "parent", :published => true) art = fast_create(Article, :profile_id => person.id, :name => "child", :parent_id => parent.id) art2 = fast_create(Article, :profile_id => person.id, :name => "child2") - get "/api/v1/search/article?parent=#{parent.id}" + get "/api/v1/search/article?parent_id=#{parent.id}" json = JSON.parse(last_response.body) assert_not_empty json['articles'] assert_equal art.id, json['articles'].first["id"] assert_equal 1, json['articles'].count end -end \ No newline at end of file +end -- libgit2 0.21.2