replace rspec_reset with obscure reset line stolen from rspec-mocks

This commit is contained in:
Jonne Haß 2014-01-06 19:19:20 +01:00
parent 7bb055932a
commit a0bbd899de
2 changed files with 5 additions and 4 deletions

View file

@ -113,7 +113,7 @@ describe User::Querying do
FactoryGirl.create(:status_message, :public => true) FactoryGirl.create(:status_message, :public => true)
bob.visible_shareables(Post).count.should == 0 bob.visible_shareables(Post).count.should == 0
end end
context 'with two posts with the same timestamp' do context 'with two posts with the same timestamp' do
before do before do
aspect_id = alice.aspects.where(:name => "generic").first.id 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 alice.post :status_message, :text => "second", :to => aspect_id
end end
end end
it "returns them in reverse creation order" do it "returns them in reverse creation order" do
bob.visible_shareables(Post).first.text.should == "second" bob.visible_shareables(Post).first.text.should == "second"
bob.visible_shareables(Post).last.text.should == "first" bob.visible_shareables(Post).last.text.should == "first"

View file

@ -51,7 +51,7 @@ describe Workers::HttpMulti do
person = @people.first person = @people.first
Typhoeus.stub(person.receive_url).and_return @failed_response 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.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" Workers::HttpMulti.new.perform bob.id, @post_xml, [person.id], "Postzord::Dispatcher::Private"
end end
@ -98,7 +98,8 @@ describe Workers::HttpMulti do
person.serialized_public_key = "-----BEGIN RSA PUBLIC KEY-----\nPsych!\n-----END RSA PUBLIC KEY-----" person.serialized_public_key = "-----BEGIN RSA PUBLIC KEY-----\nPsych!\n-----END RSA PUBLIC KEY-----"
person.save 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(person.receive_url).and_return @response
Typhoeus.stub(@people[1].receive_url).and_return @response Typhoeus.stub(@people[1].receive_url).and_return @response