Commit 5d77e0b51459b902943c006e78302f73ea461455

Authored by Joenio Costa
2 parents e219a211 8647fc67

Merge commit 'refs/merge-requests/7' of git://gitorious.org/noosfero/noosfero

app/helpers/application_helper.rb
@@ -885,7 +885,7 @@ module ApplicationHelper @@ -885,7 +885,7 @@ module ApplicationHelper
885 885
886 def template_stylesheet_path 886 def template_stylesheet_path
887 if profile.nil? 887 if profile.nil?
888 - '/designs/templates/default/stylesheets/style.css' 888 + "/designs/templates/#{environment.layout_template}/stylesheets/style.css"
889 else 889 else
890 "/designs/templates/#{profile.layout_template}/stylesheets/style.css" 890 "/designs/templates/#{profile.layout_template}/stylesheets/style.css"
891 end 891 end
test/unit/application_helper_test.rb
@@ -240,9 +240,10 @@ class ApplicationHelperTest < Test::Unit::TestCase @@ -240,9 +240,10 @@ class ApplicationHelperTest < Test::Unit::TestCase
240 assert_equal 'sampleuser', theme_owner 240 assert_equal 'sampleuser', theme_owner
241 end 241 end
242 242
243 - should 'use default template when there is no profile' do 243 + should 'use environment´s template when there is no profile' do
244 stubs(:profile).returns(nil) 244 stubs(:profile).returns(nil)
245 - assert_equal "/designs/templates/default/stylesheets/style.css", template_stylesheet_path 245 + environment.expects(:layout_template).returns('sometemplate')
  246 + assert_equal "/designs/templates/sometemplate/stylesheets/style.css", template_stylesheet_path
246 end 247 end
247 248
248 should 'use template from profile' do 249 should 'use template from profile' do