Commit 8647fc6794a0a3c436c74bc7b27e6a7655af8f4c
1 parent
1e0ffda0
Exists in
master
and in
29 other branches
accept environment's layout template definition
Showing
2 changed files
with
4 additions
and
3 deletions
Show diff stats
app/helpers/application_helper.rb
@@ -868,7 +868,7 @@ module ApplicationHelper | @@ -868,7 +868,7 @@ module ApplicationHelper | ||
868 | 868 | ||
869 | def template_stylesheet_path | 869 | def template_stylesheet_path |
870 | if profile.nil? | 870 | if profile.nil? |
871 | - '/designs/templates/default/stylesheets/style.css' | 871 | + "/designs/templates/#{environment.layout_template}/stylesheets/style.css" |
872 | else | 872 | else |
873 | "/designs/templates/#{profile.layout_template}/stylesheets/style.css" | 873 | "/designs/templates/#{profile.layout_template}/stylesheets/style.css" |
874 | end | 874 | end |
test/unit/application_helper_test.rb
@@ -186,9 +186,10 @@ class ApplicationHelperTest < Test::Unit::TestCase | @@ -186,9 +186,10 @@ class ApplicationHelperTest < Test::Unit::TestCase | ||
186 | assert_equal 'sampleuser', theme_owner | 186 | assert_equal 'sampleuser', theme_owner |
187 | end | 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 | stubs(:profile).returns(nil) | 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 | end | 193 | end |
193 | 194 | ||
194 | should 'use template from profile' do | 195 | should 'use template from profile' do |