remove unused method #can_add?
This commit is contained in:
parent
8cf8fae396
commit
4056c0da9e
2 changed files with 0 additions and 30 deletions
|
|
@ -227,14 +227,6 @@ class User < ActiveRecord::Base
|
||||||
where(conditions).first
|
where(conditions).first
|
||||||
end
|
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)
|
def confirm_email(token)
|
||||||
return false if token.blank? || token != confirm_email_token
|
return false if token.blank? || token != confirm_email_token
|
||||||
self.email = unconfirmed_email
|
self.email = unconfirmed_email
|
||||||
|
|
|
||||||
|
|
@ -407,28 +407,6 @@ describe User do
|
||||||
end
|
end
|
||||||
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
|
describe '#process_invite_acceptence' do
|
||||||
it 'sets the inviter on user' do
|
it 'sets the inviter on user' do
|
||||||
inv = InvitationCode.create(:user => bob)
|
inv = InvitationCode.create(:user => bob)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue