diff --git a/app/views/services/finder.html.haml b/app/views/services/finder.html.haml index 6208f8b7e2bef476775b853cf8f412348160d8ec..f26e73375cdea1476480fccf73b25e9843392576 100644 --- a/app/views/services/finder.html.haml +++ b/app/views/services/finder.html.haml @@ -21,7 +21,7 @@ = search_field_tag :contact_search, "", :class => 'contact_list_search', :results => 5, :placeholder => t('shared.contact_list.all_contacts') %ul - 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 %br %br diff --git a/spec/controllers/services_controller_spec.rb b/spec/controllers/services_controller_spec.rb index bd10561b1eaea49f888c35e60c1cd02442435d13..a6edf97f325474c5c1cbe8cac2a54380194a3d00 100644 --- a/spec/controllers/services_controller_spec.rb +++ b/spec/controllers/services_controller_spec.rb @@ -85,17 +85,18 @@ describe ServicesController do before do @service1 = Services::Facebook.new @user.services << @service1 + @person = Factory(:person) end it 'calls the finder method for the service for that user' do @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 end end describe '#invite' do - + before do @uid = "abc" @invite_params = {:provider => 'facebook', :uid => @uid, :aspect_id => @user.aspects.first.id} @@ -111,7 +112,7 @@ describe ServicesController do assigns[:message].should include(User.last.invitation_token) end - it 'redirects to a prefilled facebook message url' do + it 'redirects to a prefilled facebook message url' do put :inviter, @invite_params response.location.should match(/https:\/\/www\.facebook\.com\/\?compose=1&id=.*&subject=.*&message=.*&sk=messages/) end