Skip to content

Commit

Permalink
Update tests to reflect the intermediate directory creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrafanie committed Feb 6, 2015
1 parent 34b127f commit a49ae38
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions vmdb/spec/models/file_depot_ftp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
context "#upload_file" do
it "does not already exist" do
file_depot_ftp.should_receive(:connect).and_return(connection)
file_depot_ftp.should_receive(:destination_file_exists?).and_return(false)
connection.should_receive(:mkdir).with("/uploads/#{@zone.name}_#{@zone.id}/#{@miq_server.name}_#{@miq_server.id}")
file_depot_ftp.should_receive(:file_exists?).exactly(4).times.and_return(false)
connection.should_receive(:mkdir).with("uploads")
connection.should_receive(:mkdir).with("uploads/#{@zone.name}_#{@zone.id}")
connection.should_receive(:mkdir).with("uploads/#{@zone.name}_#{@zone.id}/#{@miq_server.name}_#{@miq_server.id}")
connection.should_receive(:putbinaryfile)
log_file.should_receive(:post_upload_tasks)
connection.should_receive(:close)
Expand All @@ -23,7 +25,7 @@

it "already exists" do
file_depot_ftp.should_receive(:connect).and_return(connection)
file_depot_ftp.should_receive(:destination_file_exists?).and_return(true)
file_depot_ftp.should_receive(:file_exists?).and_return(true)
connection.should_not_receive(:mkdir)
connection.should_not_receive(:putbinaryfile)
log_file.should_not_receive(:post_upload_tasks)
Expand Down

0 comments on commit a49ae38

Please sign in to comment.