Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
5a3b9c97
Commit
5a3b9c97
authored
Dec 23, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Account for `@project.description` being nil
parent
b26eb782
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
app/helpers/page_layout_helper.rb
app/helpers/page_layout_helper.rb
+1
-1
spec/helpers/page_layout_helper_spec.rb
spec/helpers/page_layout_helper_spec.rb
+8
-0
No files found.
app/helpers/page_layout_helper.rb
View file @
5a3b9c97
...
@@ -40,7 +40,7 @@ module PageLayoutHelper
...
@@ -40,7 +40,7 @@ module PageLayoutHelper
# a view
# a view
def
page_description_default
def
page_description_default
if
@project
if
@project
@project
.
description
@project
.
description
||
brand_title
else
else
brand_title
brand_title
end
end
...
...
spec/helpers/page_layout_helper_spec.rb
View file @
5a3b9c97
...
@@ -37,6 +37,14 @@ describe PageLayoutHelper do
...
@@ -37,6 +37,14 @@ describe PageLayoutHelper do
expect
(
helper
.
page_description_default
).
to
eq
'Project Description'
expect
(
helper
.
page_description_default
).
to
eq
'Project Description'
end
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
it
'falls back to brand_title'
do
allow
(
helper
).
to
receive
(
:brand_title
).
and_return
(
'Brand Title'
)
allow
(
helper
).
to
receive
(
:brand_title
).
and_return
(
'Brand Title'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment