From 3ce44d040fc1ad5fdde95a1fc023c23d1dfef904 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 29 Oct 2010 15:16:11 -0700 Subject: [PATCH] mocking out emhttprequest everywhere --- spec/helper_methods.rb | 6 ++++++ spec/lib/em-webfinger_spec.rb | 1 - spec/spec_helper.rb | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/helper_methods.rb b/spec/helper_methods.rb index cc8689924..1c4a1189a 100644 --- a/spec/helper_methods.rb +++ b/spec/helper_methods.rb @@ -27,6 +27,12 @@ module HelperMethods models end + def stub_user_message_handle_methods(user) + user.stub!(:push_to_people) + user.stub!(:push_to_hub) + user.stub!(:push_to_person) + end + def message_queue User::QUEUE end diff --git a/spec/lib/em-webfinger_spec.rb b/spec/lib/em-webfinger_spec.rb index bb6cdfecf..a90ae457d 100644 --- a/spec/lib/em-webfinger_spec.rb +++ b/spec/lib/em-webfinger_spec.rb @@ -108,7 +108,6 @@ describe EMWebfinger do context 'webfingering local people' do it 'should return a person from the database if it matches its handle' do person - EventMachine::HttpRequest.should_not_receive(:new) EM.run do finger.on_person { |p| p.should == person diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e4cf866c0..58e544a4c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -29,6 +29,7 @@ RSpec.configure do |config| config.before(:each) do stub_sockets + EventMachine::HttpRequest.any_instance.stubs(:new).returns(FakeHttpRequest.new(:success)) DatabaseCleaner.clean end end