Fix facebook finder and tests
This commit is contained in:
parent
2a11bb208e
commit
37be13d4e0
2 changed files with 7 additions and 4 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
# licensed under the Affero General Public License version 3 or later. See # the COPYRIGHT file.
|
# licensed under the Affero General Public License version 3 or later. See # the COPYRIGHT file.
|
||||||
|
|
||||||
class ServicesController < ApplicationController
|
class ServicesController < ApplicationController
|
||||||
|
helper :aspect_memberships
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|
|
||||||
|
|
@ -86,10 +86,12 @@ describe ServicesController do
|
||||||
@user.services << @service1
|
@user.services << @service1
|
||||||
@person = Factory(:person)
|
@person = Factory(:person)
|
||||||
@user.services.stub!(:where).and_return([@service1])
|
@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_users = [ ServiceUser.create(:contact => @user.contact_for(bob.person), :name => "Robert Bobson", :photo_url => "cdn1.fb.com/pic1.jpg",
|
||||||
:service => @service1, :uid => "321" ),
|
: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")]
|
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
|
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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue