fix escaping issues for file deletion

This commit is contained in:
Kyle Drake 2016-06-30 15:29:23 -07:00
parent 80d7536fe1
commit c33a8a86b1
5 changed files with 17 additions and 3 deletions

View file

@ -69,6 +69,16 @@ describe 'site_files' do
@site.reload.site_files.select {|f| f.path =~ /#{Regexp.quote '8)'}/}.length.must_equal 0
end
it 'deletes with escaped apostrophe' do
upload(
'dir' => "test'ing",
'files[]' => Rack::Test::UploadedFile.new('./tests/files/test.jpg', 'image/jpeg')
)
@site.reload.site_files.select {|s| s.path == "test'ing"}.length.must_equal 1
delete_file filename: "test'ing"
@site.reload.site_files.select {|s| s.path == "test'ing"}.length.must_equal 0
end
it 'deletes a directory and all files in it' do
upload(
'dir' => 'test',