mirror of
https://github.com/neocities/neocities.git
synced 2025-08-20 00:03:56 +02:00
fix for api calls with square bracket filenames
This commit is contained in:
parent
3087e39b57
commit
e7e5121700
3 changed files with 30 additions and 7 deletions
|
@ -53,7 +53,6 @@ describe 'site_files' do
|
|||
_(PurgeCacheWorker.jobs.collect {|p| p['args'].last}.sort).must_equal ["/notindex", "/notindex2"]
|
||||
end
|
||||
|
||||
|
||||
it 'renames in same path' do
|
||||
uploaded_file = Rack::Test::UploadedFile.new('./tests/files/test.jpg', 'image/jpeg')
|
||||
upload 'files[]' => uploaded_file
|
||||
|
@ -433,6 +432,13 @@ describe 'site_files' do
|
|||
_(@site.site_changed).must_equal false
|
||||
end
|
||||
|
||||
it 'works with square bracket filename' do
|
||||
uploaded_file = Rack::Test::UploadedFile.new('./tests/files/te[s]t.jpg', 'image/jpeg')
|
||||
upload 'files[]' => uploaded_file
|
||||
_(last_response.body).must_match /successfully uploaded/i
|
||||
_(File.exists?(@site.files_path('te[s]t.jpg'))).must_equal true
|
||||
end
|
||||
|
||||
it 'sets site changed to false if index is empty' do
|
||||
uploaded_file = Rack::Test::UploadedFile.new('./tests/files/blankindex/index.html', 'text/html')
|
||||
upload 'files[]' => uploaded_file
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue