From 481a1311b75e696ccecb487b6ab4cd8686111988 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 29 Sep 2013 15:34:25 +0000 Subject: [PATCH] Adds a project specific css class to body (#14767). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12170 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 1 + test/functional/projects_controller_test.rb | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3cac90d04..4b33e15f3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -488,6 +488,7 @@ module ApplicationHelper css << 'theme-' + theme.name end + css << 'project-' + @project.identifier if @project && @project.identifier.present? css << 'controller-' + controller_name css << 'action-' + action_name css.join(' ') diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index c8bd19c5e..79721d589 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -589,4 +589,9 @@ class ProjectsControllerTest < ActionController::TestCase assert_response :success assert_template 'show' end + + def test_body_should_have_project_css_class + get :show, :id => 1 + assert_select 'body.project-ecookbook' + end end -- 2.39.5