diff --git a/app/views/transfer/_welcome_maintenance.html.erb b/app/views/transfer/_welcome_maintenance.html.erb index b0e3571e..cc2ab32a 100644 --- a/app/views/transfer/_welcome_maintenance.html.erb +++ b/app/views/transfer/_welcome_maintenance.html.erb @@ -1,6 +1,6 @@
<% if ENV.fetch('MAINTENANCE_MESSAGE_TRANSFER', false) %> -

<%= ENV['MAINTENANCE_MESSAGE_TRANSFER'].to_s %>

+

<%= ENV['MAINTENANCE_MESSAGE_TRANSFER'].html_safe %>

<% else %>

The transfer tool is temporarily unavailable while the application is under maintenance. Please contact us at mit-theses@mit.edu with any diff --git a/app/views/transfer/new.html.erb b/app/views/transfer/new.html.erb index 39c5527d..c45200bf 100644 --- a/app/views/transfer/new.html.erb +++ b/app/views/transfer/new.html.erb @@ -180,6 +180,6 @@ <% if Flipflop.enabled?(:maintenance_mode) %> <% end %> diff --git a/test/controllers/transfer_controller_test.rb b/test/controllers/transfer_controller_test.rb index 2119f0eb..b462b8fa 100644 --- a/test/controllers/transfer_controller_test.rb +++ b/test/controllers/transfer_controller_test.rb @@ -465,6 +465,17 @@ def create_transfer_with_file assert_select 'input', disabled: true, count: 5 end + test 'form is hidden when app is in maintenance mode' do + test_strategy = Flipflop::FeatureSet.current.test! + test_strategy.switch!(:maintenance_mode, true) + + sign_in users(:transfer_submitter) + get '/transfer/new' + assert_select 'form', hidden: true, count: 1 + assert_select 'textarea', hidden: true, count: 1 + assert_select 'input', hidden: true, count: 5 + end + test 'maintenance message renders when app is in maintenance mode' do test_strategy = Flipflop::FeatureSet.current.test! test_strategy.switch!(:maintenance_mode, true)