Add tests for /srv/status behavior

This commit is contained in:
Kane York 2020-03-09 13:48:30 -07:00 committed by Kane York
parent 055cb55872
commit 218d3f5f44
1 changed files with 18 additions and 0 deletions

View File

@ -19,4 +19,22 @@ RSpec.describe ForumsController do
end
end
describe "during shutdown" do
before(:each) do
$shutdown = true
end
after(:each) do
$shutdown = nil
end
it "returns a 500 response" do
get "/srv/status"
expect(response.status).to eq(500)
end
it "returns a 200 response when given shutdown_ok" do
get "/srv/status?shutdown_ok=1"
expect(response.status).to eq(200)
end
end
end