fix for api 404

This commit is contained in:
Kyle Drake 2016-10-26 21:34:53 -05:00
parent d5493d4d23
commit 882d2fb4b2
2 changed files with 10 additions and 0 deletions

1
app.rb
View file

@ -39,6 +39,7 @@ before do
end
not_found do
api_not_found if @api
@title = 'Not Found'
erb :'not_found'
end

View file

@ -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