remove unused method #can_add?

This commit is contained in:
Fabián Rodríguez 2012-10-29 19:30:40 -02:00
parent 8cf8fae396
commit 4056c0da9e
2 changed files with 0 additions and 30 deletions

View file

@ -227,14 +227,6 @@ class User < ActiveRecord::Base
where(conditions).first
end
# @param [Person] person
# @return [Boolean] whether this user can add person as a contact.
def can_add?(person)
return false if self.person == person
return false if self.contact_for(person).present?
true
end
def confirm_email(token)
return false if token.blank? || token != confirm_email_token
self.email = unconfirmed_email

View file

@ -407,28 +407,6 @@ describe User do
end
end
describe "#can_add?" do
it "returns true if there is no existing connection" do
alice.can_add?(eve.person).should be_true
end
it "returns false if the user and the person are the same" do
alice.can_add?(alice.person).should be_false
end
it "returns false if the users are already connected" do
alice.can_add?(bob.person).should be_false
end
it "returns false if the user has already sent a request to that person" do
alice.share_with(eve.person, alice.aspects.first)
alice.reload
eve.reload
alice.can_add?(eve.person).should be_false
end
end
describe '#process_invite_acceptence' do
it 'sets the inviter on user' do
inv = InvitationCode.create(:user => bob)