From 3c28d711a12c6faa83c9da10df250ad9366f7298 Mon Sep 17 00:00:00 2001 From: Jeff Ohrstrom Date: Thu, 5 Sep 2024 14:44:25 -0400 Subject: [PATCH 1/2] add test for restart_confirmation --- .../test/fixtures/restart_confirmation.html | 46 +++++++++++++++++++ .../test/views/pun_config_view_test.rb | 15 ++++++ 2 files changed, 61 insertions(+) create mode 100644 nginx_stage/test/fixtures/restart_confirmation.html create mode 100644 nginx_stage/test/views/pun_config_view_test.rb diff --git a/nginx_stage/test/fixtures/restart_confirmation.html b/nginx_stage/test/fixtures/restart_confirmation.html new file mode 100644 index 0000000000..435f7102e9 --- /dev/null +++ b/nginx_stage/test/fixtures/restart_confirmation.html @@ -0,0 +1,46 @@ + + + + + +

+ App has not been initialized or does not exist +

+

+ This is the first time this app has been launched in your per-user + NGINX (PUN) server. This requires a configuration change followed + by a restart of your PUN server. Be sure you save all the work you + are doing in other apps that have active websocket connections + (i.e., Shell App) and you complete all file uploads/downloads. +

+

+ Clicking the "Initialize App" button will apply the configuration + change and restart your per-user NGINX (PUN) server. +

+ Initialize App + + diff --git a/nginx_stage/test/views/pun_config_view_test.rb b/nginx_stage/test/views/pun_config_view_test.rb new file mode 100644 index 0000000000..26ecfeb7aa --- /dev/null +++ b/nginx_stage/test/views/pun_config_view_test.rb @@ -0,0 +1,15 @@ +require 'test_helper' + +class PunConfigViewTest < Minitest::Test + include NginxStage::PunConfigView + + # required for generating the restart_confirmation in the PunConfigView module + def app_init_url + '/test' + end + + def test_something + expected = File.read('test/fixtures/restart_confirmation.html') + assert_equal(expected, restart_confirmation) + end +end From 9db1d684c692b3baaa9d36f617f197e8f1d5b9e2 Mon Sep 17 00:00:00 2001 From: Jeff Ohrstrom Date: Wed, 11 Sep 2024 12:52:01 -0400 Subject: [PATCH 2/2] change this test name --- nginx_stage/test/views/pun_config_view_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx_stage/test/views/pun_config_view_test.rb b/nginx_stage/test/views/pun_config_view_test.rb index 26ecfeb7aa..7e25b9d523 100644 --- a/nginx_stage/test/views/pun_config_view_test.rb +++ b/nginx_stage/test/views/pun_config_view_test.rb @@ -8,7 +8,7 @@ def app_init_url '/test' end - def test_something + def test_restart_confirmation_view expected = File.read('test/fixtures/restart_confirmation.html') assert_equal(expected, restart_confirmation) end