mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
Restart API endpoint
Redis configuration added to backend method Manager instance now restarts Logger included in metrics Spec test added API doc updated
This commit is contained in:
parent
56f5945565
commit
9a745ae9ab
4 changed files with 102 additions and 1 deletions
30
spec/integration/api/restart_spec.rb
Normal file
30
spec/integration/api/restart_spec.rb
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
require 'spec_helper'
|
||||
require 'rack/test'
|
||||
|
||||
describe Vmpooler::API::Restart do
|
||||
include Rack::Test::Methods
|
||||
|
||||
def app()
|
||||
Vmpooler::API
|
||||
end
|
||||
|
||||
# Added to ensure no leakage in rack state from previous tests.
|
||||
# Removes all routes, filters, middleware and extension hooks from the current class
|
||||
# https://rubydoc.info/gems/sinatra/Sinatra/Base#reset!-class_method
|
||||
before(:each) do
|
||||
app.reset!
|
||||
end
|
||||
|
||||
|
||||
|
||||
describe '/restart' do
|
||||
|
||||
it 'returns OK' do
|
||||
get "/restart"
|
||||
|
||||
expect(last_response.status).to eq(200)
|
||||
result = JSON.parse(last_response.body)
|
||||
expect(result).to eq({'ok' => true})
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue