diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 38f526e..9e4d387 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -889,12 +889,11 @@ module ApplicationHelper def page_title (@page ? @page.title + ' - ' : '') + - (profile ? profile.short_name + ' - ' : '') + (@topic ? @topic.title + ' - ' : '') + (@section ? @section.title + ' - ' : '') + (@toc ? _('Online Manual') + ' - ' : '') + (@controller.controller_name == 'chat' ? _('Chat') + ' - ' : '') + - environment.name + + (profile ? profile.short_name : environment.name) + (@category ? " - #{@category.full_name}" : '') end diff --git a/test/unit/application_helper_test.rb b/test/unit/application_helper_test.rb index f77be45..7106acd 100644 --- a/test/unit/application_helper_test.rb +++ b/test/unit/application_helper_test.rb @@ -466,6 +466,22 @@ class ApplicationHelperTest < ActiveSupport::TestCase assert_match(/Community nick/, page_title) end + should 'not display environment name if is a profile' do + stubs(:environment).returns(Environment.default) + @controller = ApplicationController.new + + c = fast_create(Community, :name => 'Community for tests', :nickname => 'Community nick', :identifier => 'test_comm') + stubs(:profile).returns(c) + assert_equal c.short_name, page_title + end + + should 'display only environment if no profile and page' do + stubs(:environment).returns(Environment.default) + @controller = ApplicationController.new + + assert_equal Environment.default.name, page_title + end + should 'gravatar default parameter' do profile = mock profile.stubs(:theme).returns('some-theme') -- libgit2 0.21.2