Commit 8647fc6794a0a3c436c74bc7b27e6a7655af8f4c

Authored by Aurelio A. Heckert
1 parent 1e0ffda0

accept environment's layout template definition

app/helpers/application_helper.rb
... ... @@ -868,7 +868,7 @@ module ApplicationHelper
868 868  
869 869 def template_stylesheet_path
870 870 if profile.nil?
871   - '/designs/templates/default/stylesheets/style.css'
  871 + "/designs/templates/#{environment.layout_template}/stylesheets/style.css"
872 872 else
873 873 "/designs/templates/#{profile.layout_template}/stylesheets/style.css"
874 874 end
... ...
test/unit/application_helper_test.rb
... ... @@ -186,9 +186,10 @@ class ApplicationHelperTest < Test::Unit::TestCase
186 186 assert_equal 'sampleuser', theme_owner
187 187 end
188 188  
189   - should 'use default template when there is no profile' do
  189 + should 'use environment´s template when there is no profile' do
190 190 stubs(:profile).returns(nil)
191   - assert_equal "/designs/templates/default/stylesheets/style.css", template_stylesheet_path
  191 + environment.expects(:layout_template).returns('sometemplate')
  192 + assert_equal "/designs/templates/sometemplate/stylesheets/style.css", template_stylesheet_path
192 193 end
193 194  
194 195 should 'use template from profile' do
... ...