Enable remote census configuration when remote census is active

According to the feature setting["remote_census"]:
  - Display info to enable tab when remote_census feature is disabled.
  - Display all related setting to remote_census when feature is enabled
This commit is contained in:
taitus
2019-04-10 14:16:43 +02:00
committed by Javi Martín
parent 637675a1f5
commit 0a901cb82f
4 changed files with 37 additions and 0 deletions

View File

@@ -1,5 +1,11 @@
<% if feature?(:remote_census) %>
<h2><%= t("admin.settings.index.remote_census.title") %></h2>
<%= render "settings_table", settings: @remote_census_general_settings %>
<%= render "settings_table", settings: @remote_census_request_settings %>
<%= render "settings_table", settings: @remote_census_response_settings %>
<% else %>
<div class="callout primary">
<%= t("admin.settings.index.remote_census.how_to_enable") %>
</div>
<% end %>

View File

@@ -1313,6 +1313,7 @@ en:
title: Proposals dashboard
remote_census:
title: Remote Census configuration
how_to_enable: 'To configure remote census (SOAP) you must enable "Configure connection to remote census (SOAP)" on "Features" tab.'
setting: Feature
setting_actions: Actions
setting_name: Setting

View File

@@ -1314,6 +1314,7 @@ es:
title: Panel de progreso de propuestas
remote_census:
title: Configuración del Censo Remoto
how_to_enable: 'Para configurar la conexión con el Censo Remoto (SOAP) se debe activar "Configurar la conexión al censo remoto (SOAP)" en la pestaña "Funcionalidades".'
setting: Funcionalidad
setting_actions: Acciones
setting_name: Configuración

View File

@@ -132,6 +132,35 @@ describe "Admin settings" do
end
describe "Update Remote Census Configuration" do
scenario "Should not be able when remote census feature deactivated" do
Setting["feature.remote_census"] = nil
admin = create(:administrator).user
login_as(admin)
visit admin_settings_path
find("#remote-census-tab").click
expect(page).to have_content 'To configure remote census (SOAP) you must enable ' \
'"Configure connection to remote census (SOAP)" ' \
'on "Features" tab.'
end
scenario "Should be able when remote census feature activated" do
Setting["feature.remote_census"] = true
admin = create(:administrator).user
login_as(admin)
visit admin_settings_path
find("#remote-census-tab").click
expect(page).not_to have_content 'To configure remote census (SOAP) you must enable ' \
'"Configure connection to remote census (SOAP)" ' \
'on "Features" tab.'
Setting["feature.remote_census"] = nil
end
end
describe "Skip verification" do
scenario "deactivate skip verification", :js do