spec/paperclip/storage/ftp_spec.rb in paperclip-storage-ftp-1.0.0.rc1 vs spec/paperclip/storage/ftp_spec.rb in paperclip-storage-ftp-1.0.0.rc2

- old
+ new

@@ -1,6 +1,6 @@ -require File.expand_path("../../../spec_helper", __FILE__) +require "spec_helper" describe Paperclip::Storage::Ftp do let(:attachment) do model_instance = double() model_instance.stub(:id).and_return(1) @@ -104,9 +104,21 @@ attachment.ftp_servers.second.should_receive(:delete_file).with("/files/thumb/foo.jpg") attachment.flush_deletes attachment.instance_variable_get(:@queued_for_delete).should == [] + end + end + + context "#copy_to_local_file" do + it "returns the file from the primary server and stores it in the path specified" do + attachment.primary_ftp_server.should_receive(:get_file).with("/files/original/foo.jpg", "/local/foo").and_return(:foo) + attachment.copy_to_local_file(:original, "/local/foo") + end + + it "accepts the style parameter to build the correct path" do + attachment.primary_ftp_server.should_receive(:get_file).with("/files/thumb/foo.jpg", "/local/thumb/foo").and_return(:foo) + attachment.copy_to_local_file(:thumb, "/local/thumb/foo") end end context "#ftp_servers" do it "returns the configured ftp servers" do