Commit 1c90aa7a62ecaf19eda99599591d0aa4279ca1aa

Authored by Leandro Santos
1 parent 57e3afc1

rename parent parameter to parent_id

lib/noosfero/api/v1/search.rb
... ... @@ -19,7 +19,7 @@ module Noosfero
19 19  
20 20 scope = scope.where(:type => params[:type]) if params[:type] && !(params[:type] == 'Article')
21 21  
22   - scope = scope.where(:parent_id => params[:parent]) if params[:parent].present?
  22 + scope = scope.where(:parent_id => params[:parent_id]) if params[:parent_id].present?
23 23  
24 24 category = params[:category] || ""
25 25  
... ...
test/unit/api/search_test.rb
... ... @@ -110,11 +110,11 @@ class SearchTest < ActiveSupport::TestCase
110 110 parent = fast_create(Folder, :profile_id => person.id, :name => "parent", :published => true)
111 111 art = fast_create(Article, :profile_id => person.id, :name => "child", :parent_id => parent.id)
112 112 art2 = fast_create(Article, :profile_id => person.id, :name => "child2")
113   - get "/api/v1/search/article?parent=#{parent.id}"
  113 + get "/api/v1/search/article?parent_id=#{parent.id}"
114 114 json = JSON.parse(last_response.body)
115 115 assert_not_empty json['articles']
116 116 assert_equal art.id, json['articles'].first["id"]
117 117 assert_equal 1, json['articles'].count
118 118 end
119 119  
120   -end
121 120 \ No newline at end of file
  121 +end
... ...