Commit 5a3b9c97 authored by Robert Speicher's avatar Robert Speicher

Account for `@project.description` being nil

parent b26eb782
......@@ -40,7 +40,7 @@ module PageLayoutHelper
# a view
def page_description_default
if @project
@project.description
@project.description || brand_title
else
brand_title
end
......
......@@ -37,6 +37,14 @@ describe PageLayoutHelper do
expect(helper.page_description_default).to eq 'Project Description'
end
it 'uses brand_title when Project description is nil' do
project = double(description: nil)
helper.instance_variable_set(:@project, project)
expect(helper).to receive(:brand_title).and_return('Brand Title')
expect(helper.page_description_default).to eq 'Brand Title'
end
it 'falls back to brand_title' do
allow(helper).to receive(:brand_title).and_return('Brand Title')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment