fix fb finder, flesh out test
This commit is contained in:
parent
8151f3b540
commit
07850c7cb2
2 changed files with 5 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue