Better test for unique contacts

This commit is contained in:
Raphael 2011-01-17 14:23:33 -08:00
parent 4ba58d8132
commit a7e30adc28

View file

@ -261,7 +261,10 @@ describe AspectsController do
@aspect0.contacts.include?(@hash[:contacts].first[:contact]).should be_true
end
it 'does not retreive duplicate contacts' do
@hash[:contacts].uniq.count.should == @hash[:contacts].count
@hashes = @controller.send(:hashes_for_aspects, @user.aspects, @user.contacts)
@hash = @hashes.first
flattened = @hash[:contacts].map{|c| c[:person].id}
flattened.uniq.should == flattened
end
end