Fix an error with mobile custom header

This commit is contained in:
Neil Lalonde 2013-09-16 12:55:44 -04:00
parent 13f17b2a5c
commit c845071066
2 changed files with 2 additions and 2 deletions

View File

@ -87,7 +87,7 @@ class SiteCustomization < ActiveRecord::Base
def self.custom_header(preview_style, target=:desktop)
preview_style ||= enabled_style_key
style = lookup_style(preview_style)
if style && ((target == :mobile && style.mobile_header) || style.header)
if style && ((target != :mobile && style.header) || (target == :mobile && style.mobile_header))
target == :mobile ? style.mobile_header.html_safe : style.header.html_safe
else
""

View File

@ -7,7 +7,7 @@ describe SiteCustomization do
end
let :customization_params do
{name: 'my name', user_id: user.id, header: "my awesome header", stylesheet: "my awesome css", mobile_stylesheet: '', mobile_header: ''}
{name: 'my name', user_id: user.id, header: "my awesome header", stylesheet: "my awesome css", mobile_stylesheet: nil, mobile_header: nil}
end
let :customization do