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