Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test for restart_confirmation #3781

Merged
merged 2 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions nginx_stage/test/fixtures/restart_confirmation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<html>
<head>
<style>
body {
font-family: \'Helvetica Neue\', Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 1.4;
color: #333;
font-weight: 300;
padding: 15px;
}
h2 {
font-weight: 500;
font-size: 30px;
}
.text-danger {
color: #a94442;
}
.btn-danger {
text-decoration: none;
font-weight: 400;
padding: 10px 16px;
border-radius: 6px;
color: #fff;
background-color: #d9534f;
}
</style>
</head>
<body>
<h2>
App has not been initialized or does not exist
</h2>
<p class="text-danger">
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.
</p>
<p>
Clicking the "Initialize App" button will apply the configuration
change and restart your per-user NGINX (PUN) server.
</p>
<a href="/test" class="btn-danger">Initialize App</a>
</body>
</html>
15 changes: 15 additions & 0 deletions nginx_stage/test/views/pun_config_view_test.rb
Original file line number Diff line number Diff line change
@@ -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_restart_confirmation_view
expected = File.read('test/fixtures/restart_confirmation.html')
assert_equal(expected, restart_confirmation)
end
end
Loading