Skip to content

Commit 9825556

Browse files
committed
Show space title in head. Fixes #1329
1 parent c1dc196 commit 9825556

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

app/helpers/application_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ def site_title
441441
else
442442
''
443443
# end + "TeSS (Training eSupport System)"
444-
end + TeSS::Config.site['title']
444+
end + (Space.current_space.default? ? TeSS::Config.site['title'] : Space.current_space.title)
445445
end
446446

447447
# Renders a title on the page (by default in an H2 tag, pass a "tag" option with a symbol to change) as well as

test/controllers/static_controller_test.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,4 +800,17 @@ class StaticControllerTest < ActionController::TestCase
800800
end
801801
end
802802
end
803+
804+
test 'shows space title in head when looking at a space' do
805+
space = spaces(:plants)
806+
with_host(space.host) do
807+
get :home
808+
assert_select 'head title', text: 'TeSS Plants Community'
809+
end
810+
end
811+
812+
test 'shows regular title in head when in default space' do
813+
get :home
814+
assert_select 'head title', text: 'TeSS Test Instance'
815+
end
803816
end

0 commit comments

Comments
 (0)