Skip to content

Instantly share code, notes, and snippets.

@goyox86
Created May 4, 2011 20:10
Show Gist options
  • Save goyox86/955934 to your computer and use it in GitHub Desktop.
Save goyox86/955934 to your computer and use it in GitHub Desktop.
# it "should generate a zip file" do
# user = Factory(:user)
# user.person
# file = Tempfile.new('foo')
# Zip::ZipFile.expects(:open).returns(['1'])
# 2.times { File.expects(:open).returns(file) }
# File.expects(:delete).returns('1')
# lambda {
# user.person.get_scans(nil)
# Delayed::Worker.new.work_off
# }.should change(Upload, :count).by(1)
#
# #File.delete(file.path)
# end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment