Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRaphael Sofaer <raphael@joindiaspora.com>2011-07-13 02:07:29 +0400
committerRaphael Sofaer <raphael@joindiaspora.com>2011-07-13 02:08:03 +0400
commite30b82dd45374155cd9d4510bf4882b13682e6b6 (patch)
tree644d64e47ac874d882748ee89cea2767f9d4131f /spec
parent98ebb384cae72933d8d1841050116f9e42fd8f1f (diff)
Fix resend links in inviter
Diffstat (limited to 'spec')
-rw-r--r--spec/models/invitation_spec.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/models/invitation_spec.rb b/spec/models/invitation_spec.rb
index 65629c2ec..929868ad6 100644
--- a/spec/models/invitation_spec.rb
+++ b/spec/models/invitation_spec.rb
@@ -21,7 +21,7 @@ describe Invitation do
end
it 'is valid' do
@invitation.sender.should == user
- @invitation.recipient.should == eve
+ @invitation.recipient.should == eve
@invitation.aspect.should == aspect
@invitation.should be_valid
end
@@ -323,5 +323,20 @@ describe Invitation do
}.should change(Contact, :count).by(2)
end
end
+
+ describe '#recipient_identifier' do
+ it 'calls email if the invitation_service is email' do
+ alice.invite_user(aspect.id, 'email', "a@a.com", "")
+ invitation = alice.reload.invitations_from_me.first
+ invitation.recipient_identifier.should == 'a@a.com'
+ end
+ it 'gets the name if the invitation_service is facebook' do
+ alice.services << Services::Facebook.new(:uid => "13234895")
+ alice.reload.services(true).first.service_users.create(:uid => "23526464", :photo_url => 'url', :name => "Remote User")
+ alice.invite_user(aspect.id, 'facebook', "23526464", '')
+ invitation = alice.reload.invitations_from_me.first
+ invitation.recipient_identifier.should == "Remote User"
+ end
+ end
end