From a7e30adc28ee0f5000299036e303d6bc719134fa Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 17 Jan 2011 14:23:33 -0800 Subject: [PATCH] Better test for unique contacts --- spec/controllers/aspects_controller_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index 38ef62c2d..0157be394 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -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