From 8647fc6794a0a3c436c74bc7b27e6a7655af8f4c Mon Sep 17 00:00:00 2001 From: Aurelio A. Heckert Date: Wed, 1 Jun 2011 12:17:00 -0300 Subject: [PATCH] accept environment's layout template definition --- app/helpers/application_helper.rb | 2 +- test/unit/application_helper_test.rb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3d4a9c6..61e7f71 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -868,7 +868,7 @@ module ApplicationHelper def template_stylesheet_path if profile.nil? - '/designs/templates/default/stylesheets/style.css' + "/designs/templates/#{environment.layout_template}/stylesheets/style.css" else "/designs/templates/#{profile.layout_template}/stylesheets/style.css" end diff --git a/test/unit/application_helper_test.rb b/test/unit/application_helper_test.rb index 58452a7..0fed5d1 100644 --- a/test/unit/application_helper_test.rb +++ b/test/unit/application_helper_test.rb @@ -186,9 +186,10 @@ class ApplicationHelperTest < Test::Unit::TestCase assert_equal 'sampleuser', theme_owner end - should 'use default template when there is no profile' do + should 'use environment´s template when there is no profile' do stubs(:profile).returns(nil) - assert_equal "/designs/templates/default/stylesheets/style.css", template_stylesheet_path + environment.expects(:layout_template).returns('sometemplate') + assert_equal "/designs/templates/sometemplate/stylesheets/style.css", template_stylesheet_path end should 'use template from profile' do -- libgit2 0.21.2