mirror of
https://github.com/neocities/neocities.git
synced 2025-07-21 18:16:07 +02:00
fix escaping issues for file deletion
This commit is contained in:
parent
80d7536fe1
commit
c33a8a86b1
5 changed files with 17 additions and 3 deletions
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue