put spec helper methods in spec_helper

This commit is contained in:
danielvincent 2010-12-03 15:50:17 -08:00
parent a7823485c7
commit f9e4a744a5
2 changed files with 12 additions and 10 deletions

View file

@ -5,16 +5,6 @@
module Diaspora
module UserModules
module Connecting
def send_contact_request_to(desired_contact, aspect)
##THIS METHOD IS ONLY USED IN TEST HELPERS
request = Request.instantiate(:to => desired_contact,
:from => self.person,
:into => aspect)
if request.save!
dispatch_request request
end
request
end
def dispatch_request(request)
self.pending_requests << request

View file

@ -46,6 +46,18 @@ module Resque
end
end
module Diaspora::UserModules::Connecting
def send_contact_request_to(desired_contact, aspect)
request = Request.instantiate(:to => desired_contact,
:from => self.person,
:into => aspect)
if request.save!
dispatch_request request
end
request
end
end
ImageUploader.enable_processing = false