mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
fix for api 404
This commit is contained in:
parent
d5493d4d23
commit
882d2fb4b2
2 changed files with 10 additions and 0 deletions
1
app.rb
1
app.rb
|
@ -39,6 +39,7 @@ before do
|
|||
end
|
||||
|
||||
not_found do
|
||||
api_not_found if @api
|
||||
@title = 'Not Found'
|
||||
erb :'not_found'
|
||||
end
|
||||
|
|
|
@ -14,6 +14,15 @@ def create_site(opts={})
|
|||
@pass = site_attr[:password]
|
||||
end
|
||||
|
||||
describe 'api not found' do
|
||||
it 'returns json for missing route' do
|
||||
get '/api/sdlfkjsdlfjds'
|
||||
last_response.status.must_equal 404
|
||||
res[:result].must_equal 'error'
|
||||
res[:error_type].must_equal 'not_found'
|
||||
end
|
||||
end
|
||||
|
||||
describe 'api list' do
|
||||
it 'returns all files without path' do
|
||||
create_site
|
||||
|
|
Loading…
Add table
Reference in a new issue