Skip to content

Commit

Permalink
Merge pull request #1866 from MushroomObserver/lightweight-uptime-pro…
Browse files Browse the repository at this point in the history
…be-access-point

Added ultra-lightweight access point for uptime probe.
  • Loading branch information
JoeCohen authored Jan 30, 2024
2 parents 6ab79c1 + 97a6429 commit 8a20292
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/controllers/test_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

class TestController < ApplicationController
disable_filters

# Used to test if the server is up.
def index
render(plain: "hello")
end
end
3 changes: 3 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,9 @@ def route_actions_hash
via: [:put, :patch],
as: "species_list_projects")

# ----- Test if server is up -------------------------------------
resources :test, only: [:index], controller: "test"

# ----- Test pages -------------------------------------------
namespace :test_pages do
resource :flash_redirection, only: [:show], controller: "flash_redirection"
Expand Down
11 changes: 11 additions & 0 deletions test/controllers/test_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

require("test_helper")

# Controller tests for info pages
class TestControllerTest < FunctionalTestCase
def test_tester
get(:index)
assert_equal(200, @response.status)
end
end
4 changes: 4 additions & 0 deletions test/integration/capybara/random_integration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ def test_the_homepage
assert_selector("body.observations__index")
end

def test_uptime_probe
visit("/test")
end

def test_login_and_logout
login!(rolf)

Expand Down

0 comments on commit 8a20292

Please sign in to comment.