diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index bd7e0cb38..dc9310434 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -441,7 +441,7 @@ def site_title else '' # end + "TeSS (Training eSupport System)" - end + TeSS::Config.site['title'] + end + (Space.current_space.default? ? TeSS::Config.site['title'] : Space.current_space.title) end # Renders a title on the page (by default in an H2 tag, pass a "tag" option with a symbol to change) as well as diff --git a/test/controllers/static_controller_test.rb b/test/controllers/static_controller_test.rb index cc2b09f0d..8e57815c1 100644 --- a/test/controllers/static_controller_test.rb +++ b/test/controllers/static_controller_test.rb @@ -800,4 +800,17 @@ class StaticControllerTest < ActionController::TestCase end end end + + test 'shows space title in head when looking at a space' do + space = spaces(:plants) + with_host(space.host) do + get :home + assert_select 'head title', text: 'TeSS Plants Community' + end + end + + test 'shows regular title in head when in default space' do + get :home + assert_select 'head title', text: 'TeSS Test Instance' + end end