diff --git a/lib/noosfero/api/v1/communities.rb b/lib/noosfero/api/v1/communities.rb index b9906ad..dd4f457 100644 --- a/lib/noosfero/api/v1/communities.rb +++ b/lib/noosfero/api/v1/communities.rb @@ -49,7 +49,7 @@ module Noosfero end get ':id' do - community = environment.communities.visible..find_by(id: params[:id]) + community = environment.communities.visible.find_by(id: params[:id]) present community, :with => Entities::Community, :current_person => current_person end diff --git a/test/api/communities_test.rb b/test/api/communities_test.rb index bbf2d15..dfe6bf5 100644 --- a/test/api/communities_test.rb +++ b/test/api/communities_test.rb @@ -42,7 +42,7 @@ class CommunitiesTest < ActiveSupport::TestCase get "/api/v1/communities?#{params.to_query}" json = JSON.parse(last_response.body) - assert_equal [community1.id, community2.id], json['communities'].map {|c| c['id']} + assert_equivalent [community1.id, community2.id], json['communities'].map {|c| c['id']} end should 'logged user list private community for members' do @@ -207,7 +207,7 @@ class CommunitiesTest < ActiveSupport::TestCase get "/api/v1/communities?#{params.to_query}" json = JSON.parse(last_response.body) - assert_equal [community1.id, community2.id], json['communities'].map {|c| c['id']} + assert_equivalent [community1.id, community2.id], json['communities'].map {|c| c['id']} end should 'not, anonymous create a community' do -- libgit2 0.21.2