diff --git a/app/views/admin/settings/_sdg_configuration_tab.html.erb b/app/views/admin/settings/_sdg_configuration_tab.html.erb
index 0477ed7ef..e931b67e1 100644
--- a/app/views/admin/settings/_sdg_configuration_tab.html.erb
+++ b/app/views/admin/settings/_sdg_configuration_tab.html.erb
@@ -1,3 +1,9 @@
-
<%= t("admin.settings.index.sdg.title") %>
+<% if feature?(:sdg) %>
+ <%= t("admin.settings.index.sdg.title") %>
-<%= render "featured_settings_table", features: @sdg_settings, tab: "#tab-sdg-configuration" %>
+ <%= render "featured_settings_table", features: @sdg_settings, tab: "#tab-sdg-configuration" %>
+<% else %>
+
+ <%= t("admin.settings.index.sdg.how_to_enable") %>
+
+<% end %>
diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml
index b26d43e85..cf330ae41 100644
--- a/config/locales/en/admin.yml
+++ b/config/locales/en/admin.yml
@@ -1242,6 +1242,7 @@ en:
how_to_enable: 'To configure remote census (SOAP) you must enable "Configure connection to remote census (SOAP)" on "Features" tab.'
sdg:
title: SDG configuration
+ how_to_enable: 'To show the configuration options from Sustainable Development Goals you must enable "SDG" on "Features" tab.'
remote_census_general_name: General Information
remote_census_request_name: Request Data
remote_census_response_name: Response Data
diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml
index 644139a29..18c87db4b 100644
--- a/config/locales/es/admin.yml
+++ b/config/locales/es/admin.yml
@@ -1241,6 +1241,7 @@ es:
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".'
sdg:
title: Configuración ODS
+ how_to_enable: 'Para mostrar las opciones de configuración de los Objetivos de Desarrollo Sostenible se debe activar "ODS" en la pestaña "Funcionalidades".'
remote_census_general_name: Datos Generales
remote_census_request_name: Datos Petición
remote_census_response_name: Datos Respuesta
diff --git a/spec/system/admin/settings_spec.rb b/spec/system/admin/settings_spec.rb
index f51dc86a2..558bf41d0 100644
--- a/spec/system/admin/settings_spec.rb
+++ b/spec/system/admin/settings_spec.rb
@@ -267,6 +267,7 @@ describe "Admin settings", :admin do
end
scenario "On #tab-sdg-configuration", :js do
+ Setting["feature.sdg"] = true
Setting.create!(key: "sdg.whatever")
login_as(create(:administrator).user)
@@ -313,4 +314,28 @@ describe "Admin settings", :admin do
Setting["feature.user.skip_verification"] = nil
end
end
+
+ describe "SDG configuration tab", :js do
+ scenario "is enabled when the sdg feature is enabled" do
+ Setting["feature.sdg"] = true
+ login_as(create(:administrator).user)
+
+ visit admin_settings_path
+ click_link "SDG configuration"
+
+ expect(page).to have_css "h2", exact_text: "SDG configuration"
+ end
+
+ scenario "is disabled when the sdg feature is disabled" do
+ Setting["feature.sdg"] = false
+ login_as(create(:administrator).user)
+
+ visit admin_settings_path
+ click_link "SDG configuration"
+
+ expect(page).to have_content "To show the configuration options from " \
+ "Sustainable Development Goals you must " \
+ 'enable "SDG" on "Features" tab.'
+ end
+ end
end