stub hydra for great success. also, make local_luke, local_leia, and remote_raphael fixtures.
This commit is contained in:
parent
fa59be2353
commit
914e35dcad
4 changed files with 45 additions and 10 deletions
|
|
@ -45,28 +45,29 @@ end
|
|||
ProcessedImage.enable_processing = false
|
||||
|
||||
def set_up_friends
|
||||
local_luke = Factory(:user_with_aspect, :username => "luke")
|
||||
local_leia = Factory(:user_with_aspect, :username => "leia")
|
||||
remote_raphael = Factory(:person, :diaspora_handle => "raphael@remote.net")
|
||||
connect_users_with_aspects(local_luke, local_leia)
|
||||
local_leia.activate_contact(remote_raphael, local_leia.aspects.first)
|
||||
local_luke.activate_contact(remote_raphael, local_luke.aspects.first)
|
||||
|
||||
[local_luke, local_leia, remote_raphael]
|
||||
end
|
||||
|
||||
def alice
|
||||
#users(:alice)
|
||||
@alice ||= User.where(:username => 'alice').first
|
||||
end
|
||||
|
||||
def bob
|
||||
#users(:bob)
|
||||
@bob ||= User.where(:username => 'bob').first
|
||||
end
|
||||
|
||||
def eve
|
||||
#users(:eve)
|
||||
@eve ||= User.where(:username => 'eve').first
|
||||
end
|
||||
|
||||
def local_luke
|
||||
@local_luke ||= User.where(:username => 'luke').first
|
||||
end
|
||||
|
||||
def local_leia
|
||||
@local_leia ||= User.where(:username => 'leia').first
|
||||
end
|
||||
|
||||
def remote_raphael
|
||||
@remote_raphael ||= Person.where(:diaspora_handle => 'raphael@remote.net').first
|
||||
end
|
||||
|
|
|
|||
|
|
@ -17,3 +17,16 @@ module HelperMethods
|
|||
result
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
class Typhoeus::Hydra
|
||||
def initialize
|
||||
end
|
||||
|
||||
def queue(*args)
|
||||
end
|
||||
|
||||
def run
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,16 @@ FixtureBuilder.configure do |fbuilder|
|
|||
|
||||
connect_users(bob, bob.aspects.first, alice, alice.aspects.first)
|
||||
connect_users(bob, bob.aspects.first, eve, eve.aspects.first)
|
||||
|
||||
|
||||
# Set up friends
|
||||
local_luke = Factory(:user_with_aspect, :username => "luke")
|
||||
local_leia = Factory(:user_with_aspect, :username => "leia")
|
||||
remote_raphael = Factory(:person, :diaspora_handle => "raphael@remote.net")
|
||||
connect_users_with_aspects(local_luke, local_leia)
|
||||
|
||||
local_leia.contacts.create(:person => remote_raphael, :aspects => [local_leia.aspects.first])
|
||||
local_luke.contacts.create(:person => remote_raphael, :aspects => [local_luke.aspects.first])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
11
spec/support/stub_hydra.rb
Normal file
11
spec/support/stub_hydra.rb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
class Typhoeus::Hydra
|
||||
def initialize
|
||||
end
|
||||
|
||||
def queue(*args)
|
||||
end
|
||||
|
||||
def run
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
Reference in a new issue