fix fb finder, flesh out test

This commit is contained in:
Raphael 2011-01-28 17:13:20 -08:00
parent 8151f3b540
commit 07850c7cb2
2 changed files with 5 additions and 4 deletions

View file

@ -21,7 +21,7 @@
= search_field_tag :contact_search, "", :class => 'contact_list_search', :results => 5, :placeholder => t('shared.contact_list.all_contacts') = search_field_tag :contact_search, "", :class => 'contact_list_search', :results => 5, :placeholder => t('shared.contact_list.all_contacts')
%ul %ul
- for uid in @friends.keys - for uid in @friends.keys
= render :partial => 'remote_friend', :friend => @friends[uid], :uid => uid = render :partial => 'remote_friend', :locals => {:friend => @friends[uid], :uid => uid}
- else - else
%br %br
%br %br

View file

@ -85,11 +85,12 @@ describe ServicesController do
before do before do
@service1 = Services::Facebook.new @service1 = Services::Facebook.new
@user.services << @service1 @user.services << @service1
@person = Factory(:person)
end end
it 'calls the finder method for the service for that user' do it 'calls the finder method for the service for that user' do
@user.services.stub!(:where).and_return([@service1]) @user.services.stub!(:where).and_return([@service1])
@service1.should_receive(:finder).and_return({}) @service1.should_receive(:finder).and_return("facebook_id" => {:contact => @user.contact_for(bob.person), :name => "Robert Bobson", :person => bob.person})
get :finder, :provider => @service1.provider get :finder, :provider => @service1.provider
end end
end end