From 37be13d4e05bc748c0d34b408f99beea85c53a1e Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Tue, 10 May 2011 11:22:52 -0700 Subject: [PATCH] Fix facebook finder and tests --- app/controllers/services_controller.rb | 1 + spec/controllers/services_controller_spec.rb | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index ae855f4ae..77154cec9 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -2,6 +2,7 @@ # licensed under the Affero General Public License version 3 or later. See # the COPYRIGHT file. class ServicesController < ApplicationController + helper :aspect_memberships before_filter :authenticate_user! def index diff --git a/spec/controllers/services_controller_spec.rb b/spec/controllers/services_controller_spec.rb index 7f051b93e..16c4f5f2a 100644 --- a/spec/controllers/services_controller_spec.rb +++ b/spec/controllers/services_controller_spec.rb @@ -86,10 +86,12 @@ describe ServicesController do @user.services << @service1 @person = Factory(:person) @user.services.stub!(:where).and_return([@service1]) - @hash = [ ServiceUser.create(:contact => @user.contact_for(bob.person), :name => "Robert Bobson", :photo_url => "cdn1.fb.com/pic1.jpg", :person => bob.person, - :service => @service1, :uid => "321" ), + @service_users = [ ServiceUser.create(:contact => @user.contact_for(bob.person), :name => "Robert Bobson", :photo_url => "cdn1.fb.com/pic1.jpg", + :service => @service1, :uid => "321" ).tap{|su| su.stub!(:person).and_return(bob.person)}, + ServiceUser.create(:name => "Eve Doe", :photo_url => "cdn1.fb.com/pic1.jpg", :person => eve.person, :service => @service1, + :uid => 'sdfae').tap{|su| su.stub!(:person).and_return(eve.person)}, ServiceUser.create(:name => "Robert Bobson", :photo_url => "cdn1.fb.com/pic1.jpg", :service => @service1, :uid => "dsfasdfas")] - @service1.should_receive(:finder).and_return(@hash) + @service1.should_receive(:finder).and_return(@service_users) end it 'calls the finder method for the service for that user' do @@ -139,4 +141,4 @@ describe ServicesController do }.should_not change(Invitation, :count) end end -end \ No newline at end of file +end