spec/integration_spec.rb in paperclip-storage-ftp-1.0.0 vs spec/integration_spec.rb in paperclip-storage-ftp-1.0.1
- old
+ new
@@ -27,6 +27,23 @@
user.destroy
File.exists?(FtpServer::HOME_PATH + "/#{user.id}/original/avatar.jpg").should be_false
end
+
+ it "survives temporarily closed ftp connections" do
+ user = User.new
+ user.avatar = file
+ user.save!
+
+ user.avatar = nil
+ user.save!
+
+ FtpServer.restart
+
+ user.avatar = file
+ user.save!
+ file.close
+
+ File.exists?(FtpServer::HOME_PATH + "/#{user.id}/original/avatar.jpg").should be_true
+ end
end