SPEC: Add bucket folder path only if not exists

be0555cc17
This commit is contained in:
Vinoth Kannan 2019-06-05 17:21:51 +05:30
parent f506843074
commit 4d1204b5e8
1 changed files with 11 additions and 0 deletions

View File

@ -78,4 +78,15 @@ describe "S3Helper" do
end
end
end
it "should prefix bucket folder path only if not exists" do
s3_helper = S3Helper.new('bucket/folder_path')
bucket = stub('s3_bucket')
s3_helper.expects(:s3_bucket).returns(bucket).twice
bucket.expects(:object).with("folder_path/original/1X/def.xyz").twice
s3_helper.object("original/1X/def.xyz")
s3_helper.object("folder_path/original/1X/def.xyz")
end
end