Skip to content

A platform for community discussion. Free, open, simple.

Add tests for /srv/status behavior

Kane York218d3f5f44e9
diff --git a/spec/requests/forums_controller_spec.rb b/spec/requests/forums_controller_spec.rb
index 865e7b94845..9f3ff2784ce 100644
--- a/spec/requests/forums_controller_spec.rb
+++ b/spec/requests/forums_controller_spec.rb
@@ -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