From a0bbd899dee4c7a663535cd3661460206d0be4b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Mon, 6 Jan 2014 19:19:20 +0100 Subject: [PATCH] replace rspec_reset with obscure reset line stolen from rspec-mocks --- spec/models/user/querying_spec.rb | 4 ++-- spec/workers/http_multi_spec.rb | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/spec/models/user/querying_spec.rb b/spec/models/user/querying_spec.rb index 4a2294c69..b24a3be00 100644 --- a/spec/models/user/querying_spec.rb +++ b/spec/models/user/querying_spec.rb @@ -113,7 +113,7 @@ describe User::Querying do FactoryGirl.create(:status_message, :public => true) bob.visible_shareables(Post).count.should == 0 end - + context 'with two posts with the same timestamp' do before do aspect_id = alice.aspects.where(:name => "generic").first.id @@ -122,7 +122,7 @@ describe User::Querying do alice.post :status_message, :text => "second", :to => aspect_id end end - + it "returns them in reverse creation order" do bob.visible_shareables(Post).first.text.should == "second" bob.visible_shareables(Post).last.text.should == "first" diff --git a/spec/workers/http_multi_spec.rb b/spec/workers/http_multi_spec.rb index 839e841cd..f157fa2bd 100644 --- a/spec/workers/http_multi_spec.rb +++ b/spec/workers/http_multi_spec.rb @@ -51,7 +51,7 @@ describe Workers::HttpMulti do person = @people.first Typhoeus.stub(person.receive_url).and_return @failed_response - + Workers::HttpMulti.should_receive(:perform_in).with(1.hour, bob.id, @post_xml, [person.id], anything, 1).once Workers::HttpMulti.new.perform bob.id, @post_xml, [person.id], "Postzord::Dispatcher::Private" end @@ -98,7 +98,8 @@ describe Workers::HttpMulti do person.serialized_public_key = "-----BEGIN RSA PUBLIC KEY-----\nPsych!\n-----END RSA PUBLIC KEY-----" person.save - Salmon::EncryptedSlap.rspec_reset + # Should be possible to drop when converting should_receive to expect(...).to + RSpec::Mocks.proxy_for(Salmon::EncryptedSlap).reset Typhoeus.stub(person.receive_url).and_return @response Typhoeus.stub(@people[1].receive_url).and_return @response