From 11a5fc50008cdd28a77710d45144990669095f97 Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Tue, 19 Apr 2016 11:48:49 -0300 Subject: [PATCH] compare arrays correctly --- lib/noosfero/api/v1/communities.rb | 2 +- test/api/communities_test.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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