added the pending request to the finder
This commit is contained in:
parent
80117d8ab6
commit
6be63b88f0
2 changed files with 27 additions and 7 deletions
|
|
@ -2,8 +2,15 @@
|
|||
.right
|
||||
-if friend[:contact] && !friend[:contact].pending
|
||||
= t('people.person.already_connected')
|
||||
- elsif (friend[:contact] && friend[:contact].pending)
|
||||
- elsif (friend[:contact] && friend[:contact].pending) || (friend[:request] && friend[:request].sender != friend[:person])
|
||||
= t('people.person.pending_request')
|
||||
- elsif (friend[:request] && friend[:request].sender == friend[:person])
|
||||
= link_to t('people.show.incoming_request', :name => truncate(person.name, :length => 20, :separator => ' ', :omission => '')),
|
||||
{:controller => "people",
|
||||
:action => "show",
|
||||
:id => friend[:person].id,
|
||||
:share_with => true},
|
||||
:class => 'button'
|
||||
- elsif friend[:invitation_id]
|
||||
= t('invitations.new.already_invited')
|
||||
%br
|
||||
|
|
|
|||
|
|
@ -86,11 +86,24 @@ JSON
|
|||
@service.finder["#{@user2_fb_id}"][:person].should be_nil
|
||||
end
|
||||
|
||||
it 'contains a request object if one has been sent' do
|
||||
request = Request.diaspora_initialize(:from => @user2.person, :to => @user.person, :into => @user2.aspects.first)
|
||||
Postzord::Receiver.new(@user, :object => request, :person => @user2.person).receive_object
|
||||
Request.count.should == 1
|
||||
@service.finder["#{@user2_fb_id}"][:request].should == request
|
||||
context "request" do
|
||||
before do
|
||||
@request = Request.diaspora_initialize(:from => @user2.person, :to => @user.person, :into => @user2.aspects.first)
|
||||
Postzord::Receiver.new(@user, :object => @request, :person => @user2.person).receive_object
|
||||
Request.count.should == 1
|
||||
end
|
||||
it 'contains a request object if one has been sent' do
|
||||
@service.finder["#{@user2_fb_id}"][:request].should == @request
|
||||
end
|
||||
|
||||
it 'caches the profile' do
|
||||
@service.finder["#{@user2_fb_id}"][:request].sender.profile.loaded?.should be_true
|
||||
end
|
||||
|
||||
it 'caches the sender' do
|
||||
@service.finder["#{@user2_fb_id}"][:request].sender.loaded?.should be_true
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
it 'contains a contact object if connected' do
|
||||
|
|
|
|||
Loading…
Reference in a new issue