Commit 9d28f15ab1787d65a6b8c56b705eba514d5a13e0

Authored by Antonio Terceiro
2 parents fd4c6709 4585f58a

Merge branch 'stable'

app/models/profile.rb
@@ -533,7 +533,7 @@ private :generate_url, :url_options @@ -533,7 +533,7 @@ private :generate_url, :url_options
533 end 533 end
534 534
535 def custom_header 535 def custom_header
536 - self[:custom_header] || environment.custom_header 536 + self[:custom_header] || environment && environment.custom_header
537 end 537 end
538 538
539 def custom_header_expanded 539 def custom_header_expanded
@@ -549,7 +549,7 @@ private :generate_url, :url_options @@ -549,7 +549,7 @@ private :generate_url, :url_options
549 end 549 end
550 550
551 def custom_footer 551 def custom_footer
552 - self[:custom_footer] || environment.custom_footer 552 + self[:custom_footer] || environment && environment.custom_footer
553 end 553 end
554 554
555 def custom_footer_expanded 555 def custom_footer_expanded
test/unit/profile_test.rb
@@ -851,7 +851,7 @@ class ProfileTest < Test::Unit::TestCase @@ -851,7 +851,7 @@ class ProfileTest < Test::Unit::TestCase
851 profile = Profile.new 851 profile = Profile.new
852 env = mock 852 env = mock
853 env.expects(:custom_header).returns('environment header') 853 env.expects(:custom_header).returns('environment header')
854 - profile.expects(:environment).returns(env) 854 + profile.stubs(:environment).returns(env)
855 855
856 assert_equal 'environment header', profile.custom_header 856 assert_equal 'environment header', profile.custom_header
857 end 857 end
@@ -860,7 +860,7 @@ class ProfileTest < Test::Unit::TestCase @@ -860,7 +860,7 @@ class ProfileTest < Test::Unit::TestCase
860 profile = Profile.new 860 profile = Profile.new
861 env = mock 861 env = mock
862 env.expects(:custom_footer).returns('environment footer') 862 env.expects(:custom_footer).returns('environment footer')
863 - profile.expects(:environment).returns(env) 863 + profile.stubs(:environment).returns(env)
864 864
865 assert_equal 'environment footer', profile.custom_footer 865 assert_equal 'environment footer', profile.custom_footer
866 end 866 end