dont allow directories to end with .htm or .html. Breaks the dashboard UI, also breaks the cdn

This commit is contained in:
Kyle Drake 2024-03-13 16:57:54 -05:00
parent 9dbec11353
commit 88ad085ac8
2 changed files with 15 additions and 1 deletions

View file

@ -111,6 +111,15 @@ describe 'site_files' do
# No purge cache is executed because the directory is empty
end
it 'fails for directory name ending in .htm or .html' do
@site.create_directory 'dirone'
dirone = @site.site_files_dataset.where(path: 'dirone').first
res = dirone.rename('dasharezone.html')
_(res).must_equal [false, 'directory name cannot end with .htm or .html']
res = dirone.rename('dasharezone.htm')
_(res).must_equal [false, 'directory name cannot end with .htm or .html']
end
it 'wont set an empty directory' do
@site.create_directory 'dirone'
_(@site.site_files.select {|sf| sf.path == 'dirone'}.length).must_equal 1