diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 399817e57..176e2522d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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 diff --git a/spec/support/fake_resque.rb b/spec/support/fake_resque.rb index e08eb0a03..030d0443f 100644 --- a/spec/support/fake_resque.rb +++ b/spec/support/fake_resque.rb @@ -17,3 +17,16 @@ module HelperMethods result end end + + +class Typhoeus::Hydra + def initialize + end + + def queue(*args) + end + + def run + end +end + diff --git a/spec/support/fixture_builder.rb b/spec/support/fixture_builder.rb index 52dbf2945..9345c66f3 100644 --- a/spec/support/fixture_builder.rb +++ b/spec/support/fixture_builder.rb @@ -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 diff --git a/spec/support/stub_hydra.rb b/spec/support/stub_hydra.rb new file mode 100644 index 000000000..89fb9b639 --- /dev/null +++ b/spec/support/stub_hydra.rb @@ -0,0 +1,11 @@ +class Typhoeus::Hydra + def initialize + end + + def queue(*args) + end + + def run + end +end +