mirror of
https://github.com/neocities/neocities.git
synced 2025-07-24 11:28:29 +02:00
no whitelist for catbus and fatcat
This commit is contained in:
parent
8bdf4e7663
commit
2a36bca4c0
4 changed files with 53 additions and 7 deletions
|
@ -65,6 +65,23 @@ describe 'site_files' do
|
|||
@site.site_changed.must_equal false
|
||||
end
|
||||
|
||||
it 'fails with unsupported file' do
|
||||
upload 'files[]' => Rack::Test::UploadedFile.new('./tests/files/flowercrime.wav', 'audio/x-wav')
|
||||
last_response.body.must_match /not allowed on this site/i
|
||||
File.exists?(@site.files_path('flowercrime.wav')).must_equal false
|
||||
@site.site_changed.must_equal false
|
||||
end
|
||||
|
||||
it 'succeeds for usually unsupported file on supported plans' do
|
||||
no_file_restriction_plans = Site::PLAN_FEATURES.select {|p,v| v[:no_file_restrictions] == true}
|
||||
no_file_restriction_plans.each do |plan_type,hash|
|
||||
@site = Fabricate :site, plan_type: plan_type
|
||||
upload 'files[]' => Rack::Test::UploadedFile.new('./tests/files/flowercrime.wav', 'audio/x-wav')
|
||||
last_response.body.must_match /successfully uploaded/i
|
||||
File.exists?(@site.files_path('flowercrime.wav')).must_equal true
|
||||
end
|
||||
end
|
||||
|
||||
it 'overwrites existing file with new file' do
|
||||
upload 'files[]' => Rack::Test::UploadedFile.new('./tests/files/test.jpg', 'image/jpeg')
|
||||
last_response.body.must_match /successfully uploaded/i
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue