diff --git a/app/views/about/_about_nav.html.erb b/app/views/about/_about_nav.html.erb
index a700b8c65..a15616a3b 100644
--- a/app/views/about/_about_nav.html.erb
+++ b/app/views/about/_about_nav.html.erb
@@ -20,16 +20,18 @@
-
diff --git a/app/views/about/_links.html.erb b/app/views/about/_links.html.erb
index 355776c57..722811717 100644
--- a/app/views/about/_links.html.erb
+++ b/app/views/about/_links.html.erb
@@ -1,7 +1,9 @@
<%= link_to 'What is ' + TeSS::Config.site['title_short'] + '?', about_path, class: ('selected-tab' if show == 'tess') %>
| <%= link_to 'How to Register', registering_resources_path, class: ('selected-tab' if show == 'registering') %>
- | <%= link_to 'Learning Paths', registering_learning_paths_path, class: ('selected-tab' if show == 'learningpaths') %>
+ <% if TeSS::Config.feature['learning_paths'] %>
+ | <%= link_to 'Learning Paths', registering_learning_paths_path, class: ('selected-tab' if show == 'learning_paths') %>
+ <% end %>
| <%= link_to 'Developers Guide', developers_path, class: ('selected-tab' if show == 'developer') %>
| <%= link_to 'About us', us_path, class: ('selected-tab' if show == 'about') %>
diff --git a/app/views/about/learning_paths.html.erb b/app/views/about/learning_paths.html.erb
index 05da22e96..5f49be476 100644
--- a/app/views/about/learning_paths.html.erb
+++ b/app/views/about/learning_paths.html.erb
@@ -1,6 +1,6 @@
diff --git a/test/controllers/about_controller_test.rb b/test/controllers/about_controller_test.rb
index 8b449934e..5cd2b6a6a 100644
--- a/test/controllers/about_controller_test.rb
+++ b/test/controllers/about_controller_test.rb
@@ -6,6 +6,7 @@ class AboutControllerTest < ActionController::TestCase
test 'should get first about page' do
get :tess
assert_response :success
+ assert_select 'li.about-page-category a[href=?]', registering_learning_paths_path, count: 1
end
test 'should get about us' do
@@ -13,16 +14,33 @@ class AboutControllerTest < ActionController::TestCase
assert_response :success
end
-
test 'should get about registering' do
get :registering
assert_response :success
end
-
test 'should get about developers' do
get :developers
assert_response :success
end
+ test 'should get about learning paths' do
+ get :learning_paths
+ assert_response :success
+ end
+
+ test 'should not list learning path help if feature disabled' do
+ with_settings(feature: { learning_paths: false }) do
+ get :tess
+ assert_response :success
+ assert_select 'li.about-page-category a[href=?]', registering_learning_paths_path, count: 0
+ end
+ end
+
+ test 'should access learning paths help directly even if feature disabled' do
+ with_settings(feature: { learning_paths: false }) do
+ get :learning_paths
+ assert_response :success
+ end
+ end
end